Difference between revisions of "Coding Standards"
m |
m |
||
Line 10: | Line 10: | ||
*[http://source.android.com/source/code-style.html Android recommended coding practices] | *[http://source.android.com/source/code-style.html Android recommended coding practices] | ||
− | [[Image:Customer wanted.gif|left]] | + | *[http://www.sourceformat.com/coding-standard.htm Codong Standards collections] |
+ | [[Image:Customer wanted.gif|100|thumb|left|Click to maximize]] | ||
[[Category:Programming]] | [[Category:Programming]] |
Revision as of 05:44, 29 August 2012
Remember: you shouldn't write source code just for yourself. What happens if someone else on the team needs to update it, while you're on the beach in Acapulco (or Aggersund)? Will your boss be pleased if you present unreadable code for the rest of the team to review? What if you have to make changes to code you haven't seen in the last six months? One of the most basic elements of good code layout is indentation, as discussed here:
The current author prefers Allman (and always has, before he found out that it is twice as popular as the second placed K&R = Kernighan and Ritchie in the above survey! ;-)).
The bottom line is: use a style (either because it suits you best or because you have been asked/told to do so) and use it consistently and always...
Other elements of coding style are also important. As a general and easily accessible example of coding standards see this: