Common mistakes done by every (game) programmer
This is a re-blog of a recent article in programming section of Gamasutra. It was titled "Programming Sins - Common Errors From Down In The Trenches". I would like to summarize it, but I definitely recommend you to read and start adding some points to your coding standards document.
Here is what I thought are the main points from that article
Coding standards for Games.
1. Always code for NULL cases when loading resources and using it. Expect NULL data where ever possible and code.
2. When you write functions DO NOT use ambiguous variable names, function names and parameter names.
3. Do NOT use abbreviations when naming variables/ functions/ parameters.
4. Validate pointers at least once before accessing them.
5. Validate data (clip them to valid ranges etc.)
6. Have a default state (like a default texture)
7. Consider Memory fragmentation when planning your code.
8. AVOID copy pasting code, try to always make them into functions when reusing.
You should definitely read the original article here though, as it convinces and gives excellent real world examples of why you should follow the above points.
Here is what I thought are the main points from that article
Coding standards for Games.
1. Always code for NULL cases when loading resources and using it. Expect NULL data where ever possible and code.
2. When you write functions DO NOT use ambiguous variable names, function names and parameter names.
3. Do NOT use abbreviations when naming variables/ functions/ parameters.
4. Validate pointers at least once before accessing them.
5. Validate data (clip them to valid ranges etc.)
6. Have a default state (like a default texture)
7. Consider Memory fragmentation when planning your code.
8. AVOID copy pasting code, try to always make them into functions when reusing.
You should definitely read the original article here though, as it convinces and gives excellent real world examples of why you should follow the above points.
Labels:
Common Coding Tips,
Game Programming