5 Coding standards and reviews
Team experiences are a great opportunity to learn new things and best practices from each other. In many courses, you are expected to write code as an individual and are not able to look at code that is written by others. However, at this point in the curriculum, you may learn many valuable tips and tricks from team members. You’ll want to take advantage of the treasure trove of knowledge that your team members possess. If you have the opportunity, you may consider pair programming to learn from each other.
In addition to learning from each other, you should also focus on learning to write code as a team. Obviously, you’ll want to write code that is easy to integrate, but don’t overlook the importance of consistency and documentation.
1. Create style guides
When several people contribute code to a project, it’s easy to create a mess with different coding styles. Your odds of success increase when you create a strong design together. In addition, don’t overlook the nuances of coding styles. Agree upon coding standards before you begin. At this point, in an introductory Software Engineering class, we encourage you to have your design reviewed by your instructor and Teaching Assistants and then identify coding style guidelines for your team.
Most companies use style guides. You will learn a lot when you work in different teams at different companies because you the style guides will help you to develop similar experiences to those in your team. The opportunity to work in a Software Engineering team with other students allows you to have a lot of freedom and learn a particular style. You’ll gain insight and view the world slightly differently as you work on different teams, so take the opportunity to start that learning experience now!
Here are sample style guides that we think are well done:
- Google style guides: http://google.github.io/styleguide/
- C++: https://google.github.io/styleguide/cppguide.html
- Objective-C Style Guide: http://google.github.io/styleguide/objcguide.html
- Java Style Guide: https://google.github.io/styleguide/javaguide.html
- Python Style Guide: https://github.com/google/styleguide/blob/gh-pages/pyguide.md
- HTML/CSS Style Guide: https://google.github.io/styleguide/htmlcssguide.html
- JavaScript Style Guide: https://google.github.io/styleguide/jsguide.html
- Angular JS Style Guide: https://google.github.io/styleguide/angularjs-google-style.html
- Vimscript Style Guide: https://google.github.io/styleguide/vimscriptguide.xml
Issues for your team to discuss include:
- Source file organization: organization and naming
- Source file structures: organization within files
- Code formatting and naming rules
- Best practices and other rules (possibly related to the languages/technologies)