Tuesday, February 23, 2010

An almost overwhelming uneasiness

Have you ever had this feeling when coding?

Maybe there's a better name for it than "almost overwhelming uneasiness", but it has happened twice to me in the past week. It only lasts for a split second but the feeling is very distinct.

The first time

I tried to do a Google Search and got an error page. Then I glanced down at my phone and saw that my 3G data connection had dropped out.

In that split second, these thoughts went through my head:

"Oh no, it has finally happened - some hacker has finally unleashed the ultimate virus on the internet. It has destroyed the DNS system or some vital part of infrastructure that no-one thought about and the entire internet is broken. What am I gonna do - I'll lose my job as a programmer, I've got no other marketable skills - I've been programming ever since I left Uni - how am I gonna feed my family..."

Then I ran the search again and it turned out the internet was fine.

The second time

The second time was when I was working on a Java codebase and came across this:

t1 = t2;

Again that same "almost overwhelming uneasiness", only for a split second:

"t1 = t2? What on earth does that mean? I don't understand what's going on here... I'm looking at the code above it and below it and getting more confused - how can you assign a...? I don't understand it, am I not as good a programmer as I thought?"

Then I remembered that yes, it is possible to re-assign a local variable in Java. I guess I've been hanging around these Functional Programming nutcases for so long and my programming style has become so functional that for a split second I had forgotten that variables are mutable.

0 comments: