This section lists the articles published at this site.
In my University, the programming language used for teaching how to program is Java. I was discussing with a colleague the disadvantages I saw in using it as a language for teaching programming basics and why, in my mind, it didn’t stack up against teaching a language such as plain C. The following story aims to reproduce the high points in the conversation.
Modern C++ Programming (C++11)
The new C++ standard is here and compiler support is more widespread than I had originally expected! In this post I explore some of the new language goodies including new iterators, lambda expressions and new auto semantics.
Move semantics are a new mechanism built into C++ that allow us to “move” data from one object to another. They help avoid full object copies that, today, could occur under different scenarios. Move semantics let us write special functions that can “steal” a source object’s inner data and assign it to a new object. It could help you avoid an expensive copy operation when you know the source object is not going to be used anymore.
Move semantics are a new mechanism built into C++ that allow us to “move” data from one object to another. They help avoid full object copies that, today, could occur under different scenarios. In this article I continue where I left off last week and show an updated version of the code that implements move semantics.
Inspired by the concept of Variadic Functions in C, the idea behind Variadic Templates is to allow a template to be instanciated with any number of arguments. In this article I’ll cover the new syntax and present a simple example that declares a function that uses a Variadic Template that prints the number of arguments it was intantiated with.
Inspired by the concept of Variadic Functions in C, the idea behind Variadic Templates is to allow a template to be instanciated with any number of arguments. In this article we build on those concepts to implement a printf-like function with the properties of being typesafe, don’t requiring parsing formatting characters and supporting non-POD data types.
One of the main reasons C is so different from C++ is that C does not include classes and thus would be -in principle- not object oriented. The fact that the language does not include provisions for creating classes does not preclude adopting some sort of object-oriented programming style, however. In this post I’m going to introduce Opaque-Type Oriented Programming, a technique that allows our C programs to be structured as if they were populated with objects.
C++, as many other Object-Oriented languagues, provides many facilities for us to implement our Object Oriented Designs. In this post I talk about a feature which is not frequently discussed, but must be taken into account when implementing a class hierarchy that leverages polymorphism as part of its design.
Static libraries provide a mechanism by which we can “pack” object code into reusable libraries. In this article I’m going to focus on creating static libraries of C (and C++) objects and functions.
Although the compiler most commonly used on Mac OS X is the GCC compiler, the version supplied by Apple has a handful of modifications which are specific for OS X. In particular, the -shared compiler flag, used to create Shared Objects under GNU/Linux based systems, has no effect…
Objective-C is a superset of the C programming language that adds object-oriented constructs. Unlike C++, which was influenced by Simula, Objective-C was influenced by Smalltalk, something we can definitely see in its braces syntax.
While Objective-C is a superset of C, the way its designers decided to implement the Object model was dynamic. This provides a strong contrast with C++, which, although a superset of C as well, is a static-typed language. In this post I will show how you can use the Objective-C runtime to dynamically add a method to an Objective-C class at runtime.
If you have a desktop computer and a laptop chances are that, in the long run, you end up spending more time working on your laptop than on your desktop. If repurposing your old desktop into a fully fledged server seems like too much of a commitment (either because you do not have the time to set it up or do not want to give up your desktop), you can still configure it as to offer services to other computers on your network without having to go for a server operating system…