How to improve code quality

by | Jun 28, 2021

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. 

Why?

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: 

  • Maintenance
  • Onboarding new team members
  • Debugging

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?

  1. 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.
  2. Do code reviews
  3. Pair Programming
  4. Refactor code
  5. 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.

Razvan Statescu

Razvan Statescu

Web Developer | Co-Founder & CTO @Brunch

Read more