Code quality refers to how well written the code is. Quality code is clear, simple, well tested, bug-free, refactored, documented, and performant. But the primary measure of high-quality code is its compliance with the specifications provided by the individual/organization who needs the code.
Code quality is like writing quality.
You can write a paper in 7th grade, working on your very first essay. You can also write a paper at 50 years old being a professional author.
Both papers may be working to explain the same concept or tell the same story, but you can likely distinguish that the quality of the writing of the author is better than the 7th grader.
Code quality is a reflection of the proficiency of the developer and a signal as to the quality of the end product.
It's one thing to know what a term means, but that is worthless if you don't know why you should know what code quality is in the first place. Let's break down the importance of this tech term based on two high level categories. We'll walk through an explanation as well as provide a score, 1-10, that shows you how much you should care about code quality.
The first will be if you do not have a product yet. This means that you don't have a physical product. Maybe you're in the ideation phase, or maybe you're almost ready to start development. Whichever it is, we'll get into why code quality is important and why you should or shouldn't care about it if you do not have a product.
Before getting started on your product, you should know what level of quality you are looking to build with. If you're going for an MVP, then you probably don't need high quality, but if you already have a waitlist of over 1k individuals, then you probably want to have higher code quality.
The second category is if you do have a live product. Maybe you just launched your business or maybe it's been live for years and you're continuing to improve its quality. Regardless of the scenario, if your product is live, code quality carries a different weight.
Once your product is live, it is important to maintain and improve your code quality. Sometimes you need to refactor your codebase to make it run more smoothly. Other times, if your code is really poor quality, you may be better off just starting over from scratch.
So you know what code quality is, by definition. You know if you should care about it or not depending on your situation as a business/company/product. To dig in deeper, we will walk through some examples so we can make sure you really have a solid grasp on code quality.
To really understand code quality we're going to focus on the concept of technical debt, or the cost of re-doing work caused by choosing an easier and quicker solution rather than a more difficult but stronger one.