Programming Protips: A Few Useful Tips For Beginner Game Developers
As previously mentioned, starting your programming journey is something that is not for the faint of heart. It requires troubleshooting sessions that will drive you insane. Fortunately there are a few more ways to mitigate these problems. For starters, don’t focus too much on optimizing your code when first learning. Optimization could be considered to be the root of all evil. Obviously you should be mindful of performance on a macro level, but worrying about the micro level too early will just suffocate your progress. Start optimizing after you already have a completely functional product. If you’re just starting out and you’re already primarily concerned about performance, you’re doing something wrong.
Next, learn how to use a debugger. Especially early, it will be an incredibly valuable tool not only for your sanity but for your learning as well. It will help you understand how your code works better than any other single task you can perform, and it will also help you find exactly where your code doesn’t work. On a similar note, learn how to use a profiler later on as these will also help you gain insight into your code. If you’ve learned the basics of a programming language but haven’t grasped debugging using a debugger yet, stop everything and dedicate yourself purely to that task.
While this might not apply to everyone, if you have access to a peer you should always ask for their judgement. Peer reviewed coding, while annoying initially, will prove to be invaluable in the future. Even if there is a large skill discrepancy, they can help you find code that just doesn’t make sense. When they simply go through the code and ask “Why did you do this?” you are forced to explain yourself, and a lot of times this leads to the response “Why did I do this?” that will result in better code. Many programmers are rather solitary, so this idea of peer reviewed coding might be frightening, but it’s worth getting over any shyness that is present for the benefits given above. Obviously everyone doesn’t just have another programmer they can borrow but it’s one of the better ways to check over your code.
Last, but certainly not least, always be learning more. There is a gigantic number of resources available for programming everywhere, most notably in the forms of books and internet articles. Unfortunately you can’t just learn through absorbing the information directly from the source. You have to actually read it and learn. More to the point, if you’re following a tutorial of some kind make sure you’re actually following it completely. Shortcutting your way through a tutorial won’t teach you anything, so don’t start the habit now. Doing it properly will help develop muscle memory and in turn help you learn. You’ll learn way more if you type out the code and get it to run yourself rather than dissecting a pre-developed project and hitting play.
Important Takeaways: Coding requires careful development procedures and extensive review procedures so anything that can limit the amount of backtracking that needs to be done is good for business. Don’t focus on optimizing your code on a micro level until it actually becomes a factor in the quality of your product. That’s a good way to just stop your progress. Learn how to use a debugger so that you can both learn how your code works and also find problems with the code at will. This skill is essential and should be learned immediately if it hasn’t already been. Use a peer or an experienced programmer friend to review your code whenever possible — they’ll often spot weird lines of code or wonky structuring that can be improved. Finally, actually know what you’re doing. You have to learn how to program, not just read programs. Follow tutorials all the way through and make sure you’re actually reading any materials that you have obtained instead of just skipping through and looking at examples.
If you’ve found this article helpful, don’t forget to share it with your friends on social media!
I’m Daniel, Co-Founder of Black Shell Media & Co-Author of The Definitive Guide To Game Development Success — a super actionable FREE eBook with the most self-explanatory title. Don’t forget to check it out if you haven’t already, it’s packed to the brim with my personal tips and tricks!