Closures have been around a long time yet have experienced a resurgence in the last decade. They were first implemented in the functional language Scheme then later introduced to object-oriented programming in […]
Why I have my own Android game framework
All I wanted to do was to make a game for my Android tablet, so how come I ended up writing a new C++ framework? What happened? Between the standard Android SDK […]
Android NDK Cross-Compile Setup (libpng and freetype)
Building native libraries for Android can be a bit confusing. My goal, which is likely shared by many, was to get libpng and freetyp2 working for my native OpenGL application. It took […]
Can a language be safe?
Some languages hand us sharp knives and encourage us to play with them. Other languages put us in padded rooms and discourage us from doing anything at all. Though it may sound […]
Preprocessor Case Study: Message Dispatching
Dispatching is one of those areas where I almost always rely on the preprocessor. I have done this in a variety of languages using a variety of techniques and have found nothing […]
What’s to love about C?
Antiquated, clunky, and unsafe. Though beloved to some, C is a language that many choose to hate. The mass opinion is indeed so negative it’s hard to believe that anybody would program […]
Everything wrong with exceptions
In my previous article I looked at a basic reason why exceptions are necessary. In retrospect it was more of a look at why simple error codes are insufficient; it isn’t clear […]
The Necessity of Exceptions
Exceptions often get a bad rap. They are called ineffective, inefficient, and hard to work with. In a way such accusations aren’t unfair, as most languages have totally screwed up their implementation. […]
Never use the “continue” keyword!
I was looking through some questions on StackOverflow last week when I came across a curious answer. In it there was a link to a coding standard that forbade the use of […]
What is reference counting?
Objects are created, live for a while, and then destroyed. While creation is fairly clear, the when and how of destruction is fairly language dependent. In languages like C you’re basically on […]
What’s an object? What’s a variable?
A variable is is the most fundamental concept in programming. You can’t do anything without variables. Yet most languages let you gloss over what these actually are. Simplicity often hides the truth. […]
Dangerous and confusing casting
Casting in C++ is a confusing jumble of unclear and dangerous operations. It mixes unrelated concepts. It introduces ambiguities and redundancies. It’s an essential but flawed aspect of the language.
Mismatched Allocation and Delete Nonsense
Efficient yet confused. Powerful but unsafe. So is the nature of C++ object allocation and instantiation.
Implicit Type Promotion and Conversion
C introduced it and C++ mastered it. The hellish world of implicit conversion and type promotion. A system which silently modifies, truncates, rounds, and otherwise mangles our variables.