infolock wrote:Camel Case for some is great, K&R for others is great. The coding standard defined clearly states that CamelCase is one type of naming convention but it is not what's used.
But why attempt to state that a coding standard for one language should be the coding standard for another? Languages have different syntax and semantics. Making one global standard for all programming languages isn't possible.
And if it was, camel-casing is still superior in that it separates words just as well as underscores, but it is also quicker to type.
infolock wrote:2 Spaces for tabs was used to try and minimize the amount of wasted space on a page, reduce wrapping, and keep code more compact.
For interpreted languages like JavaScript and PHP, I agree with you. In terms of wrapping, there are coding standards for that too, like having no more than 80 characters per line in C++.
infolock wrote:As for the lining up of variable equal signs, it's used for "like" definitions. If I have a block of definitions, they will be lined up to help the readability.
That is very subjective. It all depends on the way that you read the code. You argue that extra whitespace in the interest of matching up blocks of definitions increases readability. But this, to me, is like having a table of contents page without having the series of periods connecting a topic with it's page. One's mind actually needs to count the lines or relate one line to another in order to find the page number that they are looking for, especially in large listings. To me, placing the page number right next to the topic allows me to find the page quicker without any difficulties of wandering eyes.
infolock wrote:Finally, as for the thought of ranting and trying to defend a specific way of coding, it's quite the contrary.
infolock wrote:I also take pride in saying that I changed my own methods of coding over time from one method I learned and was accustomed to, and instead adapted to code as the team coded in order to try and make my code easier to read, debug, and maintain for the others.
When going from one language to another, it is professional to adhere to the best-practice standards of the language. But to create your own standards based off of other languages does not apply.
Everything that you mentioned is used in other languages. Since PHP is a new-age language, many of its developers have programmed in other languages and are familiar with other coding standards. The coding standards that we use are not based purely off of style or cosmetic appearance. They are based off of the most efficient coding standards. I'd say Java's standards are much closer to PHP's than C++'s, and that is partially because Java is more modernized and refined than C and C++, though based off of them.
Camel-casing is faster to type than underscores and, using your argument of saving space, uses less characters.
Not lining up "related" declarations also saves space.
Spaces are used instead of tabs so that code looks the same in all editors (i.e. Notepad).
The best practice coding standards are all laid out
here and are very clear and brief.
infolock wrote:maybe you should try making your own?
Maybe I should make my own programming language, too? Or maybe I don't because I don't see any reason to...
