2017-08-03
There has been a lot of discussion around blockchain in recent times. It’s been touted as a solution for everything from the financial system to aviation maintenance records, but the details of how it works has always been hidden …
2017-04-17
Parsing is the second stage of compilation, it comes right after lexical analysis. While lexical analysis focuses on breaking down the input text into a set of tokens, parsing focuses on ensuring that the relationships between those tokens …
2016-06-12
Value types in C# are Objects, but they don’t behave exactly like Objects do. A part of the reason for this is that all value types are implicitly derived from System.ValueType.
public abstract class ValueType { protected ValueType(); …
2016-03-20
Recently, while reading Jon Skeet’s excellent book“C# in Depth” I came across the long and varied history of sorting in the C# language. It provides a tantalising view of how the language has evolved over the years. Apart from being a great …
2016-02-21
Properties in C# are first class citizens, this means that they can be declared as abstract, virtual, private and protected. This is not the general use case though, most of the time properties are used to encapsulate fields.
class Customer …
2015-08-03
The best way to hire a good programmer is to be invested in his or her results. It’s like getting married. You want to be careful to choose the right kind of girl, the kind of girl that you’d want to spend the rest of your life …
2015-02-12
Compilers are wonderful, if somewhat under appreciated programs. Like the foundations of great buildings, they form the latticework on which modern computing is built. Unfortunately, they have been a bit neglected of late. Writing code …
2015-01-04
Visual Studio provides a very nice developer experience when debugging code. Emacs, on the other hand, doesn’t really shine in this area. It relies heavily the on strong debugging tools that ship with Linux, particularly GDB. While …
2014-07-13
Javascript isn’t a classical language. It’s prototypal, which is a bit like every object being a class in waiting. You can create graphs of objects where one object inherits from another, but the idea of classes doesn’t really exist.
This …
2014-04-12
In order to do almost anything with a class in C++, you need to define a few constructors. If you don’t, depending on usage, the compiler will generate those constructors for you. For example, consider the following code:
class Person …
2013-12-22
Sometimes you need to link one library on Windows and another on Linux (or vice versa). CMake has a number of variables that allow you to do this easily:
UNIX TRUE on all UNIX-like OS’s including Apple OS X and CygWin WIN32 TRUE on …
2013-12-15
Concurrency is when multiple jobs see incremental progress within the same time period. It may be that the concurrency is parallel where both jobs progress together at the same time or time sliced wherein parts of both jobs are done one …
2013-12-04
In the last scroll on CMake we discussed adding libraries that you write to your own code. This time, we look at using third party libraries out of the box. This turns out to be fairly easy with CMake - though there are exceptions …
2013-10-12
Redis and Azure table storage have a lot in common. Both have no schema’s enforced on the objects that they store. Both have limited complex query capabilities and both are touted as being “post SQL” storage. However there is one major …
2013-08-18
Concurrent bear – parallel fish
Often when writing high performance code one can fall into the trap of making assumptions about the nature of the problem. Donald Knuth said “Premature optimisation is the root of all evil”. If that is the …
2013-07-29
First for some terminology. What Emacs called “frames” is what everyone else now calls windows. This is because Emacs started out as a full screen terminal tool and GUI’s came along later and because of that what Emacs calls windows is now …
2013-07-29
In the last post we built an executable from a source file and a header only library. However, sometimes we need to build shared library binaries that can be linked into an executable. This is fairly simple with CMake. Instead of using …
2013-07-20
To do almost anything today with C++ requires the use of a number of different third party libraries. Some of these come in the form of header only libraries containing only include files (.h and .hpp). The references to these libraries are …
2013-07-17
CMake is a mix of things. It’s a cross platform makefile generator that makes porting your C/C++ code from one OS to another or from one compiler to another inside the same OS really simple. However it complicates things a bit as well …
2013-07-03
It’s interesting that when the European project kicked off it was against the backdrop of the end of the second World War. Europe had seen two world wars within a generation with much resultant suffering and destruction. There must have …
2013-06-26
Quite often when your working on cross platform code you need to build applications that use one set of libraries when compiled under Microsoft Windows and another set when compiled under Unix/Linux. Fortunately CMake is a cunning tool to …
2013-05-26
At first the place of Unicode in Linux looks simple. It is deceptively so. Linux C/C++ has support for both char and wchar_t. Let’s take a look at the char version:
#include <cstring> #include <iostream> int main(int argc, char* …
2013-05-08
Emacs can only be configured naked by moonlight.
I kid, I kid – the moonlight is optional.
Emacs has a number of “modes”. Much has been said about them on the interwebs so I’ll take the easy way out and link to a such an article.
There are …
2013-05-01
Emacs is like your average dragon, very cranky before breakfast and set in its ways. Take for instance the key bindings. For you to do anything – and I mean anything at all you need to type in an arcane set of shortcut keys, like for …
2013-04-20
The Road goes ever on and on
Down from the door where it began.
Now far ahead the Road has gone,
And I must follow, if I can,
-Bilbo Baggins, The Fellowship of the Ring
Sometimes the completely respectable Visual Studio programmer is called …
2013-01-31
Big data has been getting a lot of attention lately as a field in computing that could significantly increase the value of the vast amounts of data that are captured by digital networks and devices. Phrases like “Data is the new oil.” has …
2013-01-17
One key principle behind the design of classes is that of the encapsulation of the implementation from the clients using the code. Here a client is any bit of source code that uses the classes that you write. C++ provides an imperfect …
2012-12-10
Programmers are not known to be social creatures. It’s an unfortunate reputation really, considering that programmers spend most of their lives writing their thoughts to each other - they should be right up there in the social …
2012-12-02
In Sociable Code I mentioned that an often overlooked consideration when writing code is the strain that it puts on the programmers who end up reading it. Difficult to read code tends to mash the wetware and end up causing more bugs and …
2012-11-06
Unicode string support in Windows is a strange beast.
When Microsoft hired Dave Cutler and others to write a new OS for them they were thinking about writing a new version of OS/2. In fact the new Microsoft OS was a combined effort by …
2012-10-12
For many years programmers and strings existed in a state of balance, as much balance as could have been possible under the constant threat of undefined behaviour that sociopathic string functions threatened in any case. It was not to be …
2012-09-15
Ah, Strings. Surprisingly simple for most C# and Java programmers yet so complex for those of us left behind in the world of C and C++, Strings are perhaps one of the strangest beasts in the programming landscape. Yet they began so simple, …