Since I started to write code I was kind of obsessed with code quality. I wanted all my code to be well indented, not have duplicate logic or overcomplicated functions.
When I started programming, back in high school, it was just for my self-esteem. Then, when I started to make my own personal projects, I wanted to be able to look over the code and understand what I wanted to do there as fast as I could. Now, after 5 years of working in this industry, poor code quality means wasted time and frustration that in the end leads to money loss.
We take code quality very seriously at Brunch and we try to improve every day. We don’t want to waste unnecessary time on things like:
- Onboarding new team members
Instead of developing new features for our users.
Also, we don’t want our colleagues to have a bad mood when working on Brunch because they have to deal with spaghetti code. We want them to enjoy what they are doing and improve their skills.
What are we doing to maintain code quality?
- We have specific naming conventions. I’m not a big fan of comments unless they are absolutely necessary. I feel like you should be able to understand what a variable/method does just by reading its name.
- Do code reviews
- Pair Programming
- Refactor code
- Use Code Formatters and Code Linters
… and the list can go on.
A tool we started using recently that helps with the Code Quality is Quality by Code Climate. It makes an automated code review on your pull requests and adds comments on your code about duplicate stuff, overcomplicated functions, and more.
Also, when you first install it into an existing project, it will analyze your entire project and flag all issues that will impact your code quality.