Gert .Net
[GertDotNet]
20040121
The laws of Gert
When writing code, I use the following "Laws of Gert" to guide me:
- 1st law of Gert: No magic numbers
- Conservation of code
- Laws are meant to be broken, or changed
1st law of Gert: No Magic Numbers
Never use numbers like 1, 2, 1000 etc. Using magic-numbers will make stuff unclear and hard to change.
Conservation of code
In time, the number of lines of a solution to a problem allways grows. When extra information is found, this allways means you have to extend the code. You can never just delete code.
In everyday life this is also true: When fixing a gap in the laws, the government just adds some, they will never delete laws.
Laws are meant to be broken, or changed
If you dont, you get an inflexible system.
In everyday life this is also true: If not, we should not need a parliament.
Comments:
Een reactie plaatsen
Links to this post:
