Best possible code
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
There are a lot of beliefs about what is the best code, but almost all of it is subjective.
There are many parameters that can be used to determine if code is good or not. For example:
Programmers say that some methods increase such or such metric. Methods like:
term="object_oriented_programming" label="Object Oriented Programming" /> is supposed to make code easier to read and more fitting to requirements.
lower the amount of bugs.
to lower the amount of bugs too and make them faster to fix.
of code and make bugs harder to introduce.
We've been studying all the metrics above, and others, and all those methods, more or less since programming exists. And in about 60 years of studies, the resounding answer is: we do not know.
There are no clear numbers demonstrating any method is better than any other, on any of those metrics. There are a lot of studies demonstrating programmers believe such or such method is better, but that is not supported empirically.
In other words, all methods seem relatively equivalent generally (some may be better in specific cases).
There are a few things we do know increase code quality (across all metrics):
These two elements increase all metrics. So make sure you get good sleep, and that you show your code to others!
To know more about such things, here's a YouTube playlist with good talks about empirical approaches to software engineering:
Don't stop here. Step-by-step tutorials are fun but they only take you so far.
Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…