Wordling Your Code Base With Vim
Visualizing your code base using wordle is a nice technique to get a quick overview and impression of your source code. The downside is that you need to concatenate all your source code into a single text file before you can paste it into Wordle. In Linux, this is most easy to accomplish using command line tools. In Windows environments, however, you may not have cygwin installed, and so Vim is probably the easiest solution. (Update: A total of 35 key presses are required for this example.) Read more
Overwriting new and delete
In C++, you can generally use your own stuff if you do not like what you get from the language and standard library: You can overload functions, inherit classes and specialize templates – you can change things into what you want. You do not want to overload &&, || and comma. And you almost never want to overload the global operator new and operator delete.
But I am special, so I do want to.
While or For? A Comment On Code Entropy
I just saw Olve Maudal‘s talk from JavaZone 2011. The topic for the talk is Code Entropy and the Physics of Software. (Note: The talk is in Norwegian.) In the talk, Olve discusses how likely two semantically identical pieces of code are to be changed into each other. For example, say you have the following snippet:
if (!isValid()) {
// Handle the invalid state
} else {
// Handle the valid state
}
How likely is that to change into this one:
if (isValid()) {
// Handle the valid state
} else {
// Handle the invalid state
}
… and vice versa? Olve defines that the higher probability a piece of code has to change into a semantically identical piece of code, the higher its entropy is. In this post I will share a couple of thoughts about this. Read more
Type Guarantees, Part 1
In many typed languages the type system is a powerful system, which can be used for more things than you may be aware. In this series I want to showcase some simple examples.
When Are Two Things The Same?
A classic philosophical puzzle goes something like this.
You have a boat. Then someone replaces a part of this boat with another, similar part. Your boat it still the same boat, right? It’s not like you have a new boat if you change a floor board. But then, one by one all the parts of the boat is replaced in this way. Is it then still the same? If not – when did it become a new boat? If it still is the same boat – what if someone used the parts removed from the boat to build a whole new(?) boat?

