|
gibney.org : Technology : Programming : Coding Conventions
(Entry Nr. 92, by user 1
| edit)
|
| Short Blocks All blocks of code (In PHP, C++ etc: everything between { and }) should be shorter then 40 lines of code. This applies to main-functions, general functions, loops and if conditions. Only exception: Classes. |
| Use Classes When several functions share data, use a class to encapsulate it all. At the beginninig of the class, declare and initialize all variables. |
| Understandable Names Classes, functions and variables should have names that everyone can understand. Long names are alright. |
| No strange nestings Dont make complicated code by nesting function calls. (Look at the example inside this entry) |
| An understandable UI People should understand every detail of the UI in every situation. The UI should do what the user expects it to do. |
| Testing A list of Browsers we test for |
| Create a new entry at this position |