4 Things You Can Do to Write Fewer Bugs
Finding and fixing bugs is an art form in and of itself. It's a skill every developer needs to, well, develop and if you're interested in doing just that check out my tutorial on using the Godot Debugger.
However, for those of you already versed in digital extermination the next line of defense is learning how to write fewer bugs in the first place.
I use a bunch of techniques and practices when writing code in Godot that:
- Makes sure I include safe fallbacks for failed logic (0:23)
- Use built in calls to catch errors before I ship (2:27)
- Find places to initialize things flexibly to limit crashes and make my game easier to test (4:50)
- Write custom node warnings to catch mistakes before they happen (6:10)
- And lazily instantiate where possible to avoid calling something before it exists (8:19)
Though demonstrated in Godot 4, many of these practices and techniques work in other tools and languages. As you might notice in the video, I'm also a big fan of static typing and code hinting as ways to keep my code more... intentional.
Up Next: My Favorite Godot Plugin (it's FREE)
Continuing my series on tool, tips, and tricks for writing cleaner more efficient code while also making my life easier... check out this video on how I use this free Todo Manager to get me out of my own way.