Lately I have been amusing myself with one of life’s small ironies; I never liked to write large amounts of ‘English’, of any sort, writing down my thoughts, yet I am more that happy to spend hours writing code and even a bit of my time blogging. Hopefully you too can see the irony in that turn of events; because the way I see it, ever since I have started programming I have been Learning to Write. What is a program if not you writing down exactly how some system should operate. What is a blog if not the written form of your thoughts. When you really get down to it you could think of all computing systems as humanity writing down how we work, how we function as a society (and maybe as a species) in a way that is precise and unambiguous. For me atleast it is awe inspiring, that we can capture thought in our programs and that all we have to do is think correctly once and the right action will be performed correctly forever more (in theory at-least). For me it is truly beautiful. Just in case you were wondering, these thoughts came to me as I was editing my xMonad config file for better interoperability with gnome; coincidentally I have decided that I really want to learn how to write better Haskell…and learn what a monad is.
However, as much as I would like to discuss the beauty of code, I would also like to give a quick update onto the DB progress of Fuppes. Currently I am in the process of converting the project to still use sqlite3 but to use it through SOCI instead. Almost all of the code has been rewritten so far and I must say that I have seen a dramatic increase in code readability along with a decrease in lines of code: all while still achieving the same functionality. However, it has not all been good news and i have some more considerations to make:
- Sqlite3 has a nice feature to get the id or PRIMARY KEY of the last inserted row; however the syntax for that command is non-standard sql. That means that there will be similar, but different, commands in the other DB implementations, like mysql or postgresql. This is causing me to think that I might want to get the program to track every ID in the database and do away with any primary keys and generate the indices myself when the tables are created by their respective plugins.
- There are no unit tests in the code. I am going to have no way to test that I have not broken anything and I am not making small changes. A test harness really needs to be written for fuppes.
- The soci package (atleast for Ubuntu) was packaged really poorly. Currently I have to add a ‘-I /usr/include/soci/ ‘ into the PreRules.am file just to make sure that all the right header files are found in their expected places. There must be a better way that does not involve a rewrite of the soci code. Or perhaps that is it; I will look it up at the very least.
There are more things for me to consider but for now that is enough; that will keep me plenty busy. Currently I am just trying to rewrite the code so that it actually compiles using SOCI and then I am going to test it to see if it actually worked. I will be very excited once I manage that. I think that will be the moment when I push the changes that I have been making to the git devel repository that all Fuppes developers share.
In the meantime I am also waiting upon Eva from the Fuppes ITP bugs list on debian. Unfortunately, I am getting really close to the Ubuntu LTS Debian Import Freeze and I was hoping to see Fuppes in before that date.