http://igloocoder.com/archive/2006/07/04/394.aspx
The series first looks at the need for conventions and essentially makes the argument that consistency is paramount to good team coding. I agree.
He then covers Local Variable, Module Variables, Functions, Methods, Parameters, Properties, Classes, Interfaces, Super (and Base) Classes, UI Controls, and SQL Server Objects (also applicable to Oracle, MySQL, etc.)
I happen to agree with his observations as well as his conclusions. These are the same standards I use when something else is not mandated.
The following is a brief summary. Do read the series; there is more detail. It's an easy read.
| Local Variables | strHungarian (Yes, seriously, Hungarian Notation) strEmployeeName |
| Module Variables | _strHungarian _intRecordCount |
| Functions | PascalCase (Verb-Noun) DeterminePrice() |
| Methods | PascalCase (Verb-Noun) PoundSalt() |
| Parameters | camelCase DoThing(bool isGoodBoy) * He actually makes note to avoid bool and use enum instead |
| Properties | PascalCase read his blurb for more details |
| Classes | PascalCase |
| Interfaces | IPascalCase ICanPontificate |
| Super(Base) Classes | Read his blurb |
| UI Controls | strHungarian txtUserName * Alternate is to prefix HTML controls with 'h' => htxtUserName |
| SQL Server Objects | PascalCase (Noun-Verb) EmployeeAdd * The Noun-Verb is specific to Stored Procedures |
No comments:
Post a Comment