In the article on “How Polymorphism Works: Part 1” we learned how to create virtual functions. The method which we chose has at one significant problem with it: it requires a lot […]
How Polymorphism Works: Part 1
Polymorphism: the core of object oriented programming. Most modern languages have some concept of interfaces, virtual functions, and classes. Though each language differs in details, and may have specialized concepts, the core […]
Why Garbage Collection is not Necessary and actually Harmful
In the world of new languages it seems like garbage collection is standard feature. A way for the runtime to locate unused bits of memory and release them. It has become so […]
What is an atomic operation?
We all know that operations in a computer happen one after the other. Having multiple CPUs and instruction reordering tends to obfuscate the issue. Technically things still proceed in an orderly fashion, […]
CPU Memory – Why do I need a mutex?
Multi-threaded programming calls for semaphores, synchronized blocks, mutexes, or whatever your language happens to call them. Most of us basically understand why we need them: to prevent multiple-threads from accessing the same […]
The Cost – A Function Call
In the grand scheme of execution costs function calls come very close to the bottom of the list. They don’t cost very much at all — at least not in most compiled […]
The Cost – Instantiation and the hidden enemy “new”
Whether C++, Java or any other language, we are all familiar with instantiating an object. In those aforementioned languages the operator new happens to do just that. Obviously CPUs don’t have any […]
The Evil and Joy of Overloading
Is overloading a bad thing? Despite a wide variety of new languages supporting some form of it I continue to find articles that say overloading is bad. Worse, I find many articles […]