After thinking about my last post about that topic, I thought some additional information for people wondering about where to start with coding conventions might be prudent:
- ANY coding convention will be better than NO coding convention.
- If you have no convention in place, MSDN provides a good starting point: “NET Framework General Reference — Design Guidelines for Class Library Developers“.
- An alternative or extension may be the following download.
If you followed conventions implied in existing classes and code but have never read a formalized document, I recommend doing it. You may find same clarification (as the people at Microsoft did no allways follow their own conventions), so reading MSDN might be enlighting.
People who change projects or customers regularly should ask for the coding conventions when beginning to work in a new project. This will save you from later trouble. And in case there is none, that might tell you something about the state of the project.
At SDX we built our set of conventions upon the MSDN guidenlines (apart from saving effort, this avoids unnecessary discussions) and added conventions regarding file and directory structures, commenting, and other things. We complemented this with similar conventions for XML, guidelines regarding project setup (tool set, source code control, automated testing, …), and delivery templates (project document, installation document, …).
One major intention we had in mind was: All this is meant to guide and assist the developers, to help them doing their day-to-day work. We did not want to create a bureaucracy that gets in the way of the developer and creates additional burden.
A little bit beyond simple coding conventions, yet a usefull addition is “Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries“.
Another book that covers coding style and quite a few other topics (and is one of my all-time-favourites — I own the first edition published ’93): “Code Complete“, Steve McConnell.
And finally assaf‘s comment on another post deserves to be repeated: http://thedailywtf.com/Articles/Little_Black_Book.aspx