# Saturday, September 23, 2006

No, I'm not talking about where the brace brackets go! Coding guidelines are so much more than style guidelines. One of the things that sets me apart from many other developers I know, and especially the authors of code I am asked to fix, is a drive for simplicity. For me, that comes down to three things:

  • Start by solving the problem you're actually facing, not some enormous superset of it
  • Write the straight ahead way first, then adjust for the exceptions and strange corner cases
  • When it's all working, and every time you touch it from then on, look it over to see if you can make it simpler.

That last one is the one so many people seem to skip. Then later when I come along and read the code, I see how it could be simpler, but I hesitate to change it. They must have done it this complicated way for a reason, I think to myself. It can take quite a long time to prove to myself that no, they just settled for 'working' and ran away as fast as they could, leaving this mess for someone else to sort out later.

A mentoring client gave me a pointer to an article ostensibly on Coding Guidelines which is as much philosophical as anything else. I like it. The rules are:

  1. Make your code look like other people's code.
  2. Use the simplest design possible.
  3. Don't re-invent the wheel.
  4. Document your code.
  5. Keep security in mind.
  6. Work in increments.
  7. Work in iterations.
  8. Have your code reviewed.
  9. Don't stay blocked.
  10. Do unto others as you would have them do unto you.

There are no false notes in this list and I endorse this set of philosphies whole-heartedly.

Kate

 

Saturday, September 23, 2006 6:07:23 PM (Eastern Daylight Time, UTC-04:00)  #