![]() |
Your Naming Conventions
Please share with me you class, function and variable naming conventions.
Do you use m_ for member functions? Propercase, lowercare etc.. Do you put a type identifier at the start of your variables? $sString, $aArray etc.. What conventions do you use and why?? Thanks |
PHP Code:
|
Hungarian ( Which is CamelCase but with the datatype ) & CamelCase
|
PHP Code:
|
Classes: CamelCase (But their in 99/100 cases one word)
Functions: CamelCase Strings: small_letters_with_underscores Constants: CAPS |
Variable, function, and class names: lowercase with underscores
Constants: caps Indention: tabs (doesn't work in this code editor) PHP Code:
Plus typing all lowercase is easier on the fingers :-) |
All these are almost like religions, just find 1 that will suit for you and it will do good in your programming.
|
Quote:
Some programmers do hold their styles to similar statuses as religious beliefs. |
CamelCasing everything except for array keys there are seperated with a "_"
I also keep a very tidy codestructure ... I do follow this religiously ... as most experienced programmers do, as far as switching when I am on another project ... I either will integrate my standard in as conventions most I see are extremely sloppy or I lead the project and I set it anyway :-D Quote:
php Code:
|
Quote:
Quote:
|
Quote:
Standards to me are extremely important and 99% of the time will make or break wither or not I will even use code someone else has written. A little off-topic but this is the reason that I like Python as these standards are enforced by the language...something I would like to see happen in PHP because you can't even read some php people have written :-P |
It depends on the language I use. When I do vb at work I use camel case, but when I do C at home I tend to use underscores. I always used underscores when coding in PHP.
|
| All times are GMT. The time now is 12:27 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0