Wednesday, June 13, 2012

Exorcising the Bad Programmer in all of us

Dr. Dobb's most recent editorial What Makes Bad Programmers Different? was just a bit too binary for me. In my opinion every software developer occasionally slips and commits one of the sins he lists:
  • Their code is large, messy, and bug laden.
  • They have very superficial knowledge of their problem domain and their tools.
  • Their code has a lot of copy/paste and they have very little interest in techniques that reduce it.
  • The fail to account for edge cases, while inefficiently dealing with the general case.
  • They never have time to comment their code or break it into smaller pieces.
  • Empirical evidence plays no role in their decisions.

  • Which of us hasn't at one time or another rushed by a schedule or deadline let slip a programming peccadillo.  I know I have, the boss needs this right now, or I have to get this code checked in so John can use it for his part.

    I think the key is to find a way to exorcise the "Bad Programmer Demon" in all of us. Recently I've found that a daily "refactor" works for me. In my current position I have 2 projects that while I am not the only developer I have the majority ownership/responsibility for, each day I look for one thing that could be improved, commented or removed.  So far the results have been encouraging. Fewer bugs are slipping though to testing and overall the products "feel" more robust. Additionally I've noticed that the prospect of having to return to the code for a future refactor motivates me to do it right the first time.

    Just my $0.02

    chris' shared items

    Twitter Updates

    Official blog of Chris Lee Runyan

    Fastest C++ in the west.