Friday, 8 June 2007

Software developer you are you owne worst nightmare

Stop writing code, its just more lines where bugs and errors can hide. The following is snippet I have copied from one of my own favorite bloggers Coding Horror, which writes about "the best code, is no code at all" where he actually references another blog written by Wil Shipley who argues that we should rein in our natural tendencies to write lots of code:

The fundamental nature of coding is that our task, as programmers, is to recognize that every decision we make is a trade-off. To be a master programmer is to understand the nature of these trade-offs, and be conscious of them in everything we write.

In coding, you have many dimensions in which you can rate code:

* Brevity of code
* Featurefulness
* Speed of execution
* Time spent coding
* Robustness
* Flexibility

Now, remember, these dimensions are all in opposition to one another. You can spend three days writing a routine which is really beautiful and fast, so you've gotten two of your dimensions up, but you've spent three days, so the "time spent coding" dimension is way down.

So, when is this worth it? How do we make these decisions? The answer turns out to be very sane, very simple, and also the one nobody, ever, listens to: Start with brevity. Increase the other dimensions as required by testing.

Which is some very clever words. You cant have everything, and the things you want, always comes at a cost of something else.

Now go coding and remember to use the KISS principle (Keep It Simple Stupid)

No comments: