Internet Bandaid   [RSS Feed]

Archive for the ‘refactor’ tag

Program as little as possible

without comments

Some programmers are so detail oriented that they will try to cover as many scenarios as possible.  They will develop for today what they think will happen one or two months from now.  I use to be this kind of developer and boy do I regret it.

Businesses grow and requirements change.  As a result, the technology that drives businesses also change.  Change is difficult when systems are heavy, bloated and inflexible.   So don’t go adding potentially useful code unless you’ve got a damned good reason to do it.  In fact, don’t add new functionality/code unless 1) it’s in a contract or 2) your client asks you MORE THAN ONCE to do it.  Far too often I devoted much time to modules that were eventually scrapped because:

a) client changed his mind
b) at a later time, client requested a new feature that is closely related to an old feature, and thus, I rewrote 80% of the old feature  (I realised early one that rewriting 80% of two scripts is less work than 80% of ten scripts)

So keep your code lean and simple.  Do as little as possible so that when you inevitably refactor your work, you don’t have to throw out as much.

Written by John Lai

February 8th, 2010 at 2:37 pm

Posted in Uncategorized

Tagged with