Sunday, March 18, 2007

Good vs. Evil: Abstraction

"What are those five lines of code for?"
"I put them there because ... wait, um, they're, let me see ... they sum up x, y and z and calculate some sort of squared nearest neighbor... yep..."
"So, what do they do?"
"I just told you..."
"See, I just found that I couldn't understand those lines in the current context, so I just wanted to rip out a new method for this stuff..."
"Now how should I call this method?"
"Um... ... call it doCalculation!"

Sunday, March 11, 2007

Reaching Programmer Level 2

Today was a beautiful sunny day. The warm sunbeams on my skin told a story of the oncoming spring. And while my body started up it's Vitamin B3 production line, I remembered a conversation I had yesterday with Bernhard, a rocket engineer, that evolved around two statements:

"With hardware, theoretically anything is possible." - This statement emphasizes the limits of hardware. Theoretically you can do whatever you want, but you're limited by the material the earth provides. I admit that human beings are highly innovative - memory chip designers happily use techniques today that were believed to be physically impossible not long ago.

"With software, practically anything is possible." - Software has no inherent limitations. The concept "software" consists of a bunch of algorithms neatly packed together into a structured specification of how to solve a problem. Of course, software is limited by the hardware it is run on, which is why I usually have a problematic relationship with hardware which sometimes leads to mutual physical violence.

There is a point in the life of a software developer when you realize this (the limitlessness of software, not my problem with hardware). That realization marks your promotion to Programmer Level 1. At that time you usually know a bunch of programming languages, acquired some basic algorithmic competence and finished some minor projects. You leave the hunting grounds of not knowing how to implement things and ascend to the heavenly plains of being capable of anything.

You're Turing Complete.

Sunday, March 4, 2007

How To Diagnose Morbus Maximus Hypercodus

Morbus Maximus Hypercodus, also known as BPCD (Best Possible Coder Disease) is an uncommon illness these days. It mostly affects integral parts of the brain and while some people believe it to be a genetic dysfunction, others claim that BPCD has purely psychological causes. People who suffer from BPCD are usually not aware of it - this is in fact one of the symptoms of the disease.

The only known effect of BPCD is that the infected person writes exceptionally clean, well-structured, bug-free and easy to maintain code. The benign character of the illness is the root of a devilish new pest called WBPCD (Wannabe Best Possible Coder Disease). Curing WBPCD is hard, since the infected person usually believes to suffer from BPCD and stubbornly refuses medication.

Since spreading BPCD is supposed to have positive effects in corporate environments, you can find quite a lot of studies about effectively spreading BPCD. Mostly getting infected by BPCD involves close collaboration with people you believe to suffer from BPCD, or mind-to-mind intercourse which is easy to practice by reading.

Unfortunately you can never diagnose BPCD for yourself, since if you believe you have BPCD you're just a WBPCD case and should consider professional help. If you don't believe you have BPCD - well, it could be that you're right, but since you don't believe it this won't help you. The only known solution to this problem is to try to get BPCD infected for the rest of your life, always hoping to be infected, but always doubting your current condition.

That said, it's not too hard to diagnose BPCD if you know the symptoms. If you suffer from WBPCD you may subconsciously use this information to make others believe you're a BPCD patient, so watch out! Don't fool yourself.

Symptoms of BPCD:

  • Unbreakable optimism - BPCD patients usually start getting infected with Morbus Codus (Coding Disease). They recognize quickly that it's impossible to write bug-free code. This is the turning point in the course of disease. Some people just stop there, running away to business or law schools. The other lot is optimistic enough to hope that this time everything will be all right. While WBPCD patients just assume that their code is top notch (they believe to be BPCD infected), real BPCD people realize that optimism must be controlled with caution and test their assumptions thoroughly.

  • Easily bored and clumsy - Doing repetitive tasks will bore a person suffering from BPCD to death. If the person is also clumsy this results in a high error rate. While WBPCD patients just ignore those errors and think they will manage to do everything correctly the next time, you will find a high level of automation in the BPCD infected work environment.

  • A strange kind of perfectionism - While WBPCD causes the infected person to believe to be already perfect and requesting perfectionism from other people, BPCD makes you strive for perfectionism yourself. The typical BPCD patient is always in a mentally driven state, trying to learn and improve and help others get BPCD infected as well.

  • Annoying curiosity - Living or working with a BPCD infected person can be a challenging experience. Always seeking for answers the BPCD patient never stops questioning every possible process until he either recognizes it's worth or starts trying to make you change. People who do not want to change should try to avoid contact with BPCD infected persons to prevent physical damage.
  • Bad memory - An unimaginably bad memory can help to catch BPCD. Some patients can't remember what or why they did whatever they did last week, or if NMBR is shorthand for "number" or "Non Memorable Abbreviation". Thus they find themselves reading their own code with the eyes of a stranger. This makes BPCD infected programmers write code in a way that people who know close to nothing about the project can easily read their code. For WBPCD infected persons this just means being late to meetings.

If you want to get BPCD infected you can read this nice article about becoming a better developer at willcode4beer's.