DEV Community

Discussion on: How would you define high quality code?

Collapse
 
cjbrooks12 profile image
Casey Brooks

The projects I've worked with that had the best codebase to them actually made it difficult to write bad code with it. Bad code typically comes when there is too much going on and it is not well abstracted, so developers have trouble understanding it and end up writing more bad code, making the problem even worse.

In contrast, a good codebase has very clearly-defined structures and well-architected patterns that guide you toward the solution intended by its creators.

For example, Laravel was created for a specific purpose, and every API it opens up to developers drives you right where it wants you. You really have to put in a lot of work to use Laravel in any way other than it was designed for, and the way it encourages you to develop in it feels very natural and clean. The underlying codebase of Laravel is what I consider to be the best codebase I've ever seen and worked with.

Comparatively, Android's codebase is a bit of a mess. Don't get me wrong, I love Android and it is my favorite platform to develop for, but its codebase is messy and confusing, needlessly complex, often contradictory, and with very little direction given to the developer. It is definitely getting better now that it has matured the core framework, with Google starting to focus on better APIs for UI components and a more opinionated approach with Jetpack, but I still struggle to understand how most of the internal classes work, no matter how long I study their code.

Collapse
 
juliatorrejon profile image
Julia Torrejón

Therefore, a good codebase is the base of good code, isn't it? :)