Coding Standards
We want to create a new software project from scratch, the situation is: we are a team that is growing fast, so we are many new members, and also there are new incoming members and the question is, how do we manage to work together without dying (or killing the project) in the try?
We need to implement some coding and software standards, so everyone can write a code in a similar way and as result it will make it easier to work in any part of the project without spending a lot of time trying to figure out what the other programmer was thinking.
Next we can find a series of resources that have some useful and interesting information for taking into account.
Microsof’s .NET framework design guidelines: https://msdn.microsoft.com/en-us/library/ms229042.aspx
This guidelines show the best practices while programming using the .NET framework (the current version), we find many things to take into account like Naming guidelines (how to properly name Assemblies and DLLs, namespaces, classes, structs, variables, parameters, etc.; when to use Pascal Case and when camel Case, case sensitivity, etc.); Type design guidelines (when to choose a class and when an struct, tips for designing abstract classes, static classes, interfaces, structs, etc.); Member design guidelines (how to make a proper design for properties, constructors, events, parameters, etc.); and many other guidelines like design for extensibility, design for exceptions, common design patterns.
It is an extensive document (or web page) but it is worth to give a look to it.
Google Java Style Guide: https://google.github.io/styleguide/javaguide.html
Now is the turn of Google to show how they do stuffs, it is not as extensive as Microsoft’s but it can help any way. This has some guidelines on how to name things (variables, methods, files, etc.), how to comment code, alignment and whitespaces, some line wrapping, etc.
Insomniac games Core Coding Standard: http://www.insomniacgames.com/core-coding-standard/
This is a post form the Insomniac games page (from their blog section) where they describe the standards that they use in their team. It is like a compilation of some information from books and google’s style guide, it is focused on C++ language, but it is interesting to read it from a “real studio”.
These resources have some differences (as these guidelines are for different uses and in different programming languages), for example in the naming section one says that is recommended to use Pascal Case for everything except variables (these variables are named with camel Case) and that should be avoided to use the Hungarian notation, but in another they say that the methods should be named with camel Case, and other says that the things should be named with Hungarian notation, so totally contradictory; but at the end they also have many similarities and totally could help the programmers to be aware on things that are good while coding (and the things that don’t).
Leave a Reply