Kicking the tires

In the hot, cruel desert of this space, wind howled in solitude. A stone statue lay on the ground like a man asleep, succumbing to its own weight, mental and physical. For more than one year, no stirring. The sun shines on again today. A wanderer passes by on a camel, and looks at the strange statue. He swears that he saw it moving.

Read More

The SQLite3 C++ API

I was looking for some practice with DBs, and my choice fell on the SQLite project, maybe only because it looked lighter than PostgreSQL, which I also plan to play with. My first general impression about the API is that it looks a little too much C-oriented, even though I am not sure whether this is a good or a bad thing, and I am ignorant about the latitude of choice an engineer has when designing an API that has to interact with applications written in either C or C++.

Read More

Hash tables

Before C++11, hash tables could be used in C++ only with some tricks. The only associative container available in the STL used to be the std::map (along with its sibling, the multimap). This class, however, is implemented as a binary search tree, and does not provide a way to customize a hash function. What hurt me most was that you didn’t have the great performances offered by a true hash map: almost constant time insert, delete, and search (depending on how good is the hash function). You insert in O(log N) time. You find in O(log N) time. Too bad.

Read More