Difference between revisions of "Coding Standards"
m |
m |
||
Line 8: | Line 8: | ||
Other elements of coding style are also important. As a general and easily accessible example of coding standards see this: | Other elements of coding style are also important. As a general and easily accessible example of coding standards see this: | ||
− | + | *[[C programming/House of Technology C coding policy|House of Technology C coding policy] | |
*[http://source.android.com/source/code-style.html Android recommended coding practices] | *[http://source.android.com/source/code-style.html Android recommended coding practices] | ||
*[http://www.sourceformat.com/coding-standard.htm Codong Standards collections] | *[http://www.sourceformat.com/coding-standard.htm Codong Standards collections] |
Revision as of 06:45, 27 September 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:
- [[C programming/House of Technology C coding policy|House of Technology C coding policy]
- Android recommended coding practices
- Codong Standards collections
- Introduction to MISRA C