I am with writing a coding standards document for a team of about 15 with a load of between 10 and 15 projects a year. Amongst other sections (which I may post here as I get to them) I am writing a section on code formatting. So to start with, I think it wise that, for whatever reason, we establish some basic, consistent code formatting/naming standards.
I've looked at roughly 10 projects written over the last 3 years from this team and I'm obviously finding a pretty wide range of styles. Contractors come in and out and at times, double the team size.
I am looking for a few suggestions for code formatting and naming standards that have really paid off ... but that can also really be justified. I think consistency and shared-patterns go a long way to making the code more maintainable ... but are there other things I ought to consider when defining said standards?
How do you lineup parens? Do you follow the same paren guidelines when dealing with classes, methods, try catch blocks, switch statements, if else blocks etc.
Do you line up fields on a column? Do you notate private variables with an underscore? Do you follow any naming conventions to make it easier to find particulars in a file? How do you order the members of your class?
What about suggestions for namespace, packaging or source code folder/organization standards? I tend to start with something like
<com|org|...>.<company>.<app>.<layer>.<function>.ClassName
and I'm curious to see if there are other more accepted practices that what I am accustomed to before I venture off dictating these standards. Links to standards published online would be great too - although I've done a bit of that already.