Posts

Showing posts from February, 2024

Examples Available On GitHub

Image
So, I've opened a GitHub repository .   The idea is to provide some real code to back up my claims about building larger applications. I put a lot of thought into the platform, language, etc., that I wanted to use.  I finally settled on:

The Basics Of Event Handling

Image
As I mentioned in my first post about building classes , I try to enforce a software design where classes are arranged in a pyramid-like hierarchy , with methods only trickling downwards and data only trickling upwards. This approach may seem a bit restrictive initially, as you often encounter situations where lower classes need to inform higher classes that something has happened. Since lower classes cannot directly call higher classes under any circumstances, this is often addressed in games by simply polling the lower classes for changes. A classic game loop would look something like this:

Remove Error Handling From Your Code

Image
There are two main ways of directly dealing with error handling in modern programming: exceptions and error codes. Unfortunately, neither of them is any good. Although various techniques exists to aid in debugging - like asserting and logging - these methods are not really great for catching unexpected behaviour or the user being a douche. Essentially we are stuck with the two bad ones.