Loud ramblings of a Software Artisan

Tuesday 23 January 2007

Adding features by removing code

Lately I have been removing code from AbiWord to make it cleaner. I have removed 3 different hash/map container classes, one set container class, with it associated RB Tree implementation, a pair container class. This for one feature: cleaner code. All of these have replaced by a standard container from libstdc++. I also templatized the string implementation class as it was already written in such a way that they were almost identical.

But why has this to be done? It is historical.

Originally, when the project started, back in 1997, it had to be build with compilers that were not up to the standard. So the project was started with its own implementation of standard containers, the same you find in the Standard C++ library. The use of templates was not allowed, nor namespaces. But today, this is no longer the case. We build with gcc everywhere, vendor compilers as an option, and it works well. In 2003, I did switch several of the major containers to use template instead of generic void* that go in the way when one decide to store integer in that. For 2.5.1 I decide it was time to remove the least used classed, even more, when in the case of map/hashtable, they were duplicating themselves. Yes, I removed 3 different instances of the same functionality! AbiWord should be less bloated.

More later...

Sunday 14 January 2007

Abi ports

So AbiWord 2.5.0 is out, heavy last minute hacking. Since the Linux version does not really need my help, being in good hands (don't worry I still have a couple of ideas under the hood), I spent some time setting the Mac build straight an square. The good news is that it finally compiles (maybe after 2.5.0 release, I don't remember if I had to commit more stuff), the bad is that it fails running, or at least running in something useful. I have to figure out what is going on.

One of the thing I had to spend some time is what I will call abiports: it is a ports system to provide the ever growing list of dependencies. As of today, AbiWord 2.5.0 depends on glib, wv, libgsf, libpng[1], popt[2] and enchant. The idea is to compile them with limited dependencies to embed them in the application bundle.

And for those who are wondering why I waste time on the Mac build instead of working on Free Software platforms, it is because somebody has to do it, for the sake of the project...

Notes

[1] yes this library is not part of MacOS X

[2] about to be ditched