From the course: Agile Software Development: Code Quality

What is code quality? - SonarQube Tutorial

From the course: Agile Software Development: Code Quality

Start my 1-month free trial

What is code quality?

- [Instructor] Code quality, what does that phrase mean to you? I imagine you have your opinions. And a search of the internet will yield many more. For this course, it's the desire to create code that is easy to understand and work with. Why should we care about code quality? The best way to answer this question is to start by considering the many different audiences that consume the code that you write. First you have the computer. When it doesn't understand the code that you write, it lets you know by reporting compiler or runtime errors. That one's fairly objective. You mess up, it reports an error, no big deal. And then there are the other members of your team, humans who will need to be able to read the code you write and understand what it does. If they don't understand it, they'll have to ask you questions every time they need to make a change. Hopefully you'll be available to answer their questions. And even more so, hopefully you'll still remember the answers. That brings us to another important audience for the code that you write, your future self. How confident are you that you'll be able to one day read what you wrote and still understand it? How much do you trust your memory to preserve your intention? I don't know about you, but I don't trust myself. I don't trust my future availability for my team. And I certainly don't trust my future memory. But here's the thing. I don't have to, because I know my code will speak for me as long as I consider code quality.

Contents