03 Apr, 2023Laura Corkin2 min read

Good code practice in 2023

What is good code practice? Every developer will have practices that they personally feel are important to their work process and the way they develop. At Common Code, we pride ourselves on the quality of the work we do. We believe that doing a good job means creating clean, consistent code bases that are easy to maintain and work in. To ensure that the quality of the work we do is excellent, we follow some tried-and-true coding practices that we recommend for any software development team.


Breaking work down into smaller pieces

Common Coders use an Agile approach for day-to-day work, and a fundamental part of that approach includes breaking our work down into smaller, achievable pieces. This process helps with the cadence of our work, and allows us to communicate to our clients realistic timelines for work getting done. For example, if our team is working on a rebuild of an app, we might divide the task into all of the different features in the app. From that level of complexity we would then break it down further into pieces of work that our developers agree can be achieved within a week. So the way we break tasks into smaller pieces helps not only our team understand where we are on a project, it also helps the people that we work with understand the progress we’re making towards developing the larger goal.

Sharing our work early and often

We are proud of the talented team of developers at Common Code. We have a range of knowledge and skill sets which can be effectively leveraged by frequently sharing our work with each other. In a remote working world, sharing our work early and often helps us work more efficiently. Without the ability to tap the shoulder of the senior developer behind us, consciously making an effort to share our work is a helpful habit to get into because it can help us work faster and make good decisions more quickly. Let’s say we are making decisions about using a framework or library to implement a feature - if another team member has used one before and they share their knowledge, they can help remove the ‘paradox of choice’ that arises when we have to choose something new to add to a project. It can also help us avoid picking a library that is fraught with problems or is time consuming and difficult to implement.

Peer reviewing

Peer reviewing code base changes is essential to maintaining our high quality of work. When we use peer review, it allows everyone on the team to share knowledge, which lowers the risk of one person on our team holding all knowledge of important changes being made. Peer reviewing of code also reduces the risk of errors going unnoticed and prevents bugs from being merged into the main code base. Another benefit of peer review is that it can help with the consistency of the code that is being written. Inconsistent style in a code base can make it harder for new developers to onboard onto a project, and make it harder to maintain.

Cloud

Using cloud services (for example, Docker) helps with consistency of the environment in which we are developing code. They allow us to not have to worry about what we’re running on our personal machines because the software can run anywhere we are working on it. By using cloud services we are able to reduce the number of times we might hear “well, it works on my machine...”

Linting

Our strategy for consistency isn’t solely focused on environments. To keep the code that lives in our code bases consistent we use tools for linting. These tools help us check our code for potential errors or inconsistencies, and keep the style of the code consistent. For instance, we may use the linting library Prettier for our typescript code because it formats the code for us which makes it look neater. Implementing a linting practice helps us catch potential issues earlier in our development process before they become difficult or costly to fix.

Good practice is a collective endeavour

Good code practice is not a singular effort. The processes we have at Common Code that help keep our code excellent are driven by collaboration. We have a strong culture of teamwork which allows us to leverage each other’s knowledge and experience, and empowers us to create clean, consistent code bases.

Share this article