Defining Code Quality
Learn about CISQ’s quality model and how to define code quality.
We'll cover the following
Defining code quality
It’s tough to define the meaning of quality when it comes to program code. The reason is that all developers will have their own opinion of what it means. One developer could argue that we should focus on writing readable code because it will be easier to understand and maintain and, by that, reduce the chance of us inserting any bugs into the code. Another developer could argue that we should focus on writing compact code; that is, as few code lines as possible. Even if the code is harder to read, less code will give us fewer chances to introduce bugs in the code.
Here, the two developers would argue for the same thing—fewer bugs in the code—with two contradictory positions.
Let’s take a look at a small example using Python as our language. We want to create a list that holds all possible combinations we can get by rolling two dice.
The first one will use more code, but it will be easier to understand:
Get hands-on with 1400+ tech skills courses.