Better Programming

The Geekaholic blog by Aditya Mukherjee contained an interesting blog post recently. The title of the post was “A Faster vs. Better Approach to Reach Your Programming Goal”. Aditya had a number of insights on how to program better. He declared that a module has to work within a program. The result should be a program which works as a unit. You should write code in such a way that, no matter how much code you add, the existing code will work.

Aditya goes on to recommend you ensure new developers will be able to work with your code. It would also be best if such a new developer could pick up any piece of your code and understand it without having to go through all of your other code. Here is a list of Aditya’s additional recommendations:
  1. Make use of functions
  2. Make use of Macros
  3. Make use of procedures

This all comes at a great time for me. I am in the middle of coding the new changes in our software for next year. We have a mandated deadline for our code. I planned to attend a training class this month. So I got all my work done early. Another developed came forward and said he would not be done on time. These two facts resulted in me getting some more work.

Now I do not dislike more work, especially when it is software development. More specifically I love to code. However I have a one week to complete a task that was supposed to last a couple weeks. This is life in the software development world. I am not planning to work too many extra hours this week to cope with it. Instead I plan to change the way I work. I check in my code daily to ensure all code is integrated early. I also am coding the bare minimum required functionality first.

Here is the bad news. I may be taking some shortcuts in my coding to get the job done on time. That does not mean that I do not use functions or procedures. That would be plain evil. However I might hard code some values. And I might use the leanest methods to pass data around instead of creating classes or even structures. This is the price you pay when you get unreasonable demands and there are finite resources.