Coding Rules
-
Always try to keep your functions below 20 lines of code.
-
All ways try to make as many functions static and/or private as possible.
-
Any state must be represented by an enum definition with a descriptive name.
-
If you make code which are general and you think others could reuse, put it in a separate project (dll), which you can open source.
-
If you make code that other projects in your organization can reuse, put it in a separate project (dll), which you can share with others.
-
Never write SQL or java script unless it makes your application faster or more user friendly or both.
-
Try to only have one line under an if or else statement. If you have many lines, change them to a function call.
-
If you have a function call with more than input 2 parameters, think about how you can change it to a new class with properties and one or more simple methods.
-
If you have an if statement with more than two boolean expressions, then change it into a function call.
-
You should only ever use switch case operators on enum state variables, and try to use return instead of break.