This website uses cookies

Read our Privacy policy and Terms of use for more information.

Hello and Welcome, I’m your Code Monkey!

What does "clean code" actually mean? It’s a tricky question because there's actually no single universal definition, everyone has their own, this is MY definition:

Clean code is code that is easy to understand and easy to modify.

That's it! Super simple.

Clean code is not about impressing other programmers. It’s not about following some arbitrary academic rule. It’s not about making the code look fancy. It’s all very practical.

  • Can you open a script 3 months from now and instantly understand what it does?

  • Can you add a new feature without breaking 5 unrelated systems?

  • Can you fix a bug without needing to keep the entire codebase in your head?

If yes, then you probably wrote clean code.

This matters a lot in game development because games naturally become messy due to their iterative nature. You start with movement, then add enemies, UI, sounds, levels, saving, upgrades, menus, cutscenes, balancing, and suddenly your "simple" project has 100 systems all talking to each other and building new features becomes harder and harder until you quit the project.

Clean code is what lets you keep building without the whole thing collapsing.

I learned this the hard way. My first few games I just focused on making them work and nothing else. And technically that works, until you add enough complexity at which point everything breaks. On my first Steam game Survivor Squad I remember how by the end of the project (which took maybe 1 year to make) it was getting harder and harder, nearly impossible, to add more features onto it. Any time I added something it broke a dozen other things. That’s exactly because at the time I did not know anything about clean code so I just wrote whatever worked.

After suffering that I learned that I need to be careful with the quality of my code if I want my games to get better and better. That’s how I was eventually able to make my 9th Steam game which was an Automation Colony Building Tower Defense game Dinky Guardians. There’s no way I would have been able to build such a complex game (in such a short 7 month timeframe) if I had not focused on writing high quality clean code.

So if you want to make games more complex than a basic Flappy Bird prototype, I recommend you focus on writing clean code! If you do then you’ll be able to build any game you can think of, regardless of how complex it is.

Check out my talk on YouTube titled: "How to Write High Quality Code that doesn't fall apart"

Best of luck writing code your future self can actually understand!

Thanks for reading! Best of luck in your game dev journey!

Get Rewards by Sending the Game Dev Report to a friend!

(please don’t try to cheat the system with temp emails, it won’t work, just makes it annoying for me to validate)

Thanks for reading!

Code Monkey

Reply

Avatar

or to participate