Friday, 5 January 2007 6:46 PM
drneil
Rules are for the obedience of fools and the guidance of wise men.
It always amazes me how developers seem to think there are hard and fast rules for creating some part of their solution.
Let me make this clear:
There is no one right way to build software.
There are lots of wrong ways in certain circumstances.
Let's take an example you are putting together a little application to move some files around and help you set up your development environment. You see you could make your life easy but it would involve using a goto statement. We all know "using goto is against the rules" so you spend an extra 40 minutes on this code that will get thrown away and never used again. Doh!
Actually speaking of goto, I love goto. How do you think the cpu gets from one instruction to another? Some new magic OO hardware that Intel created? No, the jmp command is used. It moves the current instruction pointer to another memory address, and then executes the instruction at that address. If you follow this and fully understand how the CPU is working then you fall into the second category, the one where rules are for guidance.
What are your thoughts?
Most developers have coding conventions, are they useful?
Do they slow you down?
When do they help you?