Difference between revisions of "Coding Standards"
m |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
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 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 | + | 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... |
− | [Category | + | 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://www.sourceformat.com/coding-standard.htm Codong Standards collections] | ||
+ | *[http://www.embedded.com/electronics-blogs/beginner-s-corner/4023981/Introduction-to-MISRA-C Introduction to MISRA C] | ||
+ | <!--[[Image:Customer_wanted.gif|right]]--> | ||
+ | [[Category:Programming]] |
Latest 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: