-
Notifications
You must be signed in to change notification settings - Fork 15
Code standards
ajamesVISD edited this page Mar 22, 2016
·
2 revisions
- No hard-coding choices. If you think that Players ought to have facial features that talk, or that Games ought to start in mysterious groves, or that broccoli restores 10 health points, great — just do not write it directly into the game engine. Find a way to make extensions that make such features available.
- Write this code as if a whole other team needed to be able to work on it. That means using sane naming conventions, commenting your code, and documenting your thinking to the wiki.
- Favor composition over inheritance. This is the Holy Writ of good Java programming. What does it mean? There's a good discussion here. Give changeable behaviors to things, rather than saying they simply have them. Wherever the change is, put it in an intelligent chunk of code so the change can be changed.