Don’t Be A Hotshot Programmer, Be A Boring Programmer

July 8th, 2010 by Kevin | Posted under development.

Should a programmer be boring? Before that, what does it mean for a programmer to be boring? Following are the points that make it worthwile to be a boring programmer rather than a hotshot programmer.

1) Boring Programmers Write Simple Code.
Hotshot programmers find it cool to write complex code that achieves reduction in CPU usage and/or memory usage. Boring programmers prefer writing code that will be simple to understand by other programmers who read it. They do not mind that it may take a couple of more CPU cycles if the code that they write is easily readable and maintainable. Because boring programmers know that in most situations, the memory and CPU speed available does not matter over writing clean, maintainable code.

Hotshot programmers may write:

unsigned uCycleCheckBox(unsigned uCur)
{
   return ((uCur<=1)?(uCur?0:1):(uCur==4)?2:(uCur+1));
}

Boring programmers will write the same as:

unsigned uCycleCheckBox(unsigned uCur)
{
   unsigned uRet;

   if(uCur <= 1)
   {
      if(uCur != 0)
         uRet = 0;
      else
         uRet = 1;
   }
   else
   {
      if(uCur == 4)
         uRet = 2;
      else
         uRet = uCur+1;
   }
   return(uRet);
}

2) Boring Programmers Write Documentation.
Hotshot programmers may see documentation as a waste of time. After all, it takes too much time to write it. And then it has to be updated with changes in the sytem. However, boring programmers write documentation and update it with the major code changes that affect the documentation even if it means that they can't start working on other cool requirements till they have completed it. They write documentation so that they or any other programmers who start working on their code can read such documentation and understand about the code instead of having to bother other programmers about it.

3) Boring Programmers Read Documentation.
Hotshot programmers feel they have no need to read documentation as they feel comfortable reading the source code. Boring programmers read the documentation of the system that they are working on. They know that if the documentation has been created then it is meant as a standard view of the system and that will bring them up to date with how the system has been implemented. To find a solution to a problem that they are working on the first time, instead of randomly searching into the code, boring programmers look into documentation and try to find out a method that will provide the standard solution to the problem.

4) Boring Programmers Test Code.
Hotshot programmers like to pass the responsibility of testing to the testers because they want to start working on new, cool features the moment the existing functionality seems "finished". Boring programmers prefer to test the code that they write. They prefer to find bugs in their code rather than postponing it to the testers. So they make an effort to test their code as much as possible even if it means that it is boring. For this, boring programmers step through their code and debug every path in the code even if it seems boring.

So are you a boring programmer or a hotshot? Do you strive for clean and maintainable code? Do you believe in writing good documentation for the system you work on? And do you thoroughly test your code or do you think it is the task that testers are paid for?

 

Related Posts:

Tags:

Comments

6 Responses to “Don’t Be A Hotshot Programmer, Be A Boring Programmer”
  1. ManiKanta says:

    Nice article! Article has mastered the area of development. I saw few programs written like you said ‘hotshot’ style. Very bad though.

    I’d like to be a AVERAGE programmer by myself… :)

    [Reply]

    Kevin Reply:

    Hi ManiKanta,

    Average programmer is different from a boring programmer. An average programmer is someone with average skills at that point of time. However a boring programmer may be average or he may be quite good with his skills that he realizes there is no need for hotshot programming.

    [Reply]

  2. Abhishek says:

    Very good suggestion yaar.. i think boring programmer’s program is easy to test…

    [Reply]

  3. Frank Silbermann says:

    I would have written it as follows (I hope the spaces are proportional):

    unsigned uCycleCheckBox(unsigned uCur){
    return ( (uCur<=1)?
    ( uCur? 0
    : 1
    )
    : (uCur==4)?
    2
    : (uCur+1)
    );
    }

    [Reply]

    Frank Silbermann Reply:

    Well, I guess the spaces weren’t maintained. My point is that if you break the expression into multiple lines and indent the lines logically, it’s as readabile as the nested-if — with less boilerplate. I’ll try to do it with periods for spaces. Sadly, it probably still won’t line up right without a fixed-space font, but you get the idea:

    unsigned uCycleCheckBox(unsigned uCur){
    ….return ( (uCur<=1)?
    ………………………………..( uCur?
    ……………………………………………0
    …………………………………………:..1
    ………………………………..)
    ……………………………:…(uCur==4)?
    ………………………………………………….2
    ………………………………………………:…(uCur+1)
    …………);
    }

    [Reply]

    Kevin Reply:

    Thanks Frank, I get the idea. It is of course more readable than the first example. However, using simple if/else will be easily read by a programmer of any level and easier to maintain :)

    [Reply]

Do you have any comments on Don’t Be A Hotshot Programmer, Be A Boring Programmer ?

Spam protection by WP Captcha-Free