Coding for fun and spending your weekend indoors, more like.

One problem I have with coding for RPoL, besides the general fact I have no idea what I’m doing, is that I bite off more than I can chew.  I had to abort a massive project I undertook for the site in about 2005 because it was too big.  I know what I need to do, but the end of the tunnel is so far away there’s not even the glimmer of hope of some light shining down it.  The more I work on the changes the more I realise needs to be done.

This all stems from opting not to use mySQL (or any structured database) back when I made RPoL in 2000.  I opted for Berkeley databases, some of which are so basic they are actually flat text files, each record being a line in the file.  The sad fact of all this is at the time I knew I should use SQL, but I looked at mySQL and could just not get my head around it (actually, it might have been to the fact that when I was originally learning programming they forced a lot of SQL onto us then and I hated it; I think it took over ten years to get over the trauma).  Later in about 2004 when I revisited it, it all seemed so easy and I had no idea why I didn’t use them before.  I’ve been slowly migrating the databases over to mySQL since.

Using SQL is a.. well, it’s a no-brainer really, but the unfortunate fact is that it requires a lot of work on my behalf for very little difference to the users.  Once it’s done it makes future changes much easier, and makes any data manipulations done much less error-prone (i.e. you can update an individual “cell” (if you thinking about databases like an Excel spreadsheet) rather than manipulating an entire “row” when all you want to do is chance one cell).

Everything was originally in Berkeley.  I moved the game list over to mySQL but everything else in 2005 was still in Berkeley.  The project I started then was to change every other database over to mySQL in one hit.  It was.. massive.  As I mentioned above, I eventually gave up.  Doing so much in one hit was beyond my enthusiasm levels, I do need the rush from releasing a new version to keep me going.  I get the personal satisfaction of a finished version, and the enthusiasm that I then get from users keeps me happy and keen.

I’ve been doing the changes piecemeal since.  I’ve moved the user database and stickylist to mySQL, as well as writing the new (at the time) rMail to use mySQL.  Now I’m upgrading the players (in a game) and characters (in a game) databases to mySQL.  I can’t really break it down any further, but this is a big change, I think the biggest.

I’ve got to change the routines for; how a message is posted (and edited), how the game menu (thread list) is rendered, now the private thread list is rendered, how a message is displayed (I verify that the user has access to view the thread, I don’t assume that just because they’ve somehow got hold of the URL that they have permission to view), how the cast list works, how the dice roller works, how the character profiling works, how the GM menu works.

The first and last ones on that list are the really big ones.  I’ve basically rewritten the GM script, that’s 7,300 lines (which equates to 30,787 words or 256,000 characters).  That’s in the range of a novel.  I’ve now got to battle about 2/3rds that size again with the message posting.  My enthusiasm, is waning again and I’ve started to do some very stupid things to increase my enthusiasm.

More on my stupidity later.