Protos' Musings

"In the long run men hit only what they aim at" — Thoreau

Becoming a better programmer

with 4 comments

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” — Martin Fowler

Programming the proper way

I love programming, and I love programming the proper way. I belong to the school of thought that believes that programming is as much an art or a craft, as it is a science or an engineering. For me programming is not just another activity that humans do to make money. It is my passion! Of course, I do earn money by way of programming, but then there is nothing wrong with that.

You might be the best programmer around, and you may be knowing the ins-and-outs of the system/platform that you use. But that won’t be very useful unless you write code in a manner that makes understanding your code a snap, really! This is important if your code has to talk sensibly to the other members of your team, including those poor programmers (mostly inexperienced guys) who are going to maintain that code a few months or years down the line.

Right now you are probably wondering, “What the heck is this ‘programming the proper way’, and how can I go about achieving that?”. I am getting there, and so please be patient.

Please note that whatever that follows has nothing to do with Java, DotNet, Delphi or any other particular technology. These are some of the all-time great ideas about programming. These are by no means my ideas. I am just trying to expound the cause of what I like to call ‘programming the proper way’. It is about becoming a better programmer.

Self-documenting code — the central theme behind becoming a better programmer

In order to program the proper way, we need to have a good grasp of the concept of Self-documenting code, and how to write that. As Daniel Read says in his wonderful essay, “Self-documenting code does not get written by accident”. You need to work on that, just like any other skill in this world.

To know more about Self-documenting code and other programming principles, please read this article by Daniel Read at his award winning portal DeveloperDotStar. I highly recommend anything that Dan writes.

Elsewhere, there are a couple of nice articles about writing Self-documenting code. Read them in this order:

  1. The Art of Code Documentation
  2. Using PDL for Code Design and Documentation [Highly recommended]

Then there are other basic but highly ignored stuff regarding good conventions in programming, and luckily, there is a very nice summary available in the form of Software Development Guidelines at the Literate Programming website.

Code Complete — the bible of programming

Of course, whatever links that you see listed above happen to be free resources in the web from where you can start the journey. However, if you really care deep enough to become a better programmer there is a kind of one stop resource; a resource from where you can learn whatever you learned above and some more and then some even more. I am talking here about the wonderful book by Steve McConnell, Code Complete, whose Second Edition was published last year. It is without a trace of doubt, one of the best books ever written on programming.

So what do you do next?

Of course, I am not so naive to assume or suggest that just by reading this post and by implementing the ideas proposed here you will become a great programmer. But this much is assured: you will be a better programmer that you were before you knew about this stuff. To become a truly great programmer, there are just a couple of things you can do. One: work hard at your programming skills including practicing a lot and Two: read as much as and as often as you can about programming, and go back to One.

Finally, even if you don’t care a damn about any of these ideas, please do the programming community a favour by passing on this message to your colleagues and friends. Who knows, someone somewhere might just be interested in becoming a better programmer! Thanks for having the patience to read thus far :).

Advertisements

Written by Proto

November 1, 2005 at 19:03 hrs

Posted in Programming

4 Responses

Subscribe to comments with RSS.

  1. Great write-up buddy!!
    Writing code in a self-documenting sensible readable way should be a suo motto task for a pgmmer.
    I think a nice idea would be write a tool which will test if the pgm adheres to the standards as intended.
    Here we have a system which prevents check-in of code if it fails to adhere to certain standards (most of them are related to performance and SQL tuning) nothing related to std:s talked by you. So 90% of code is messy and fixing bugs is a night-mare of sorts!

    Arun

    November 2, 2005 at 20:29 hrs

  2. Indeed, and a tip for helping to keep your code clean a bit more easily. Use a compiler with a find/replace feature. Not every time you name a variable is it going to end up being what that variable is actually used for (at least in the learning stages of programming and later depending on how you work). Just make sure you don’t replace part of the name of another variable as well.

    Taylor

    March 24, 2007 at 23:24 hrs

  3. FREE CONDOMS HERE!

    FREE CONDOMS HERE!, Totally Free Condoms, discreetly packaged and shipped.

  4. […] to be a better programmer – the redux It was in the December of 2005 that I first wrote about how to be a better programmer. At that time I was into my fifth year as a programmer, and though I wanted to write what I am […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: