Strap yourself in boys, we're in for some chop chops.
Chop chops... these are.
Call it refactoring if you want.
Straightening out five year old 'funny codes'. (Though I'm not sure if it will pass the dailyWTF criteria.)
LIBRARY SYSTEM version 2.001 screenshot
Four++ years ago a client asked me to continue a three year old project of theirs.
To be completed in seven weeks... that is.
(The topic of rushed projects have been a recurring item in this blog but no most of our projects are not rushed : )
So seven weeks, I was asked... if I could do it.
Being a proud programmer back then... I accepted it.
For pride... for glory... for the challenge.
(Payment will even be given a year after. Nine months after to be exact... so financial motivation was non-existent.)
Plus back then I felt like I was an ultra-bionic coder with 28 fingers and 42 mind-to-fingers 2048-bit internal buses that can tap three alternate universes for quantum fueled code-pounding mojos.
And I have FoxPro... of course.
VFP6 was the main weapon back then.
The client's old project was done in Visual Basic 5 if I'm not mistaken. (With multiple ocx files)
So if you're me faced with a rushed project to be finished in seven weeks... the best thing to do first is of course to convert things to Visual FoxPro.
I knew VB back then... but I'm more familiar with the Fox.
In pressured situations you tend to go with those you are familiar with.
Raw slashin' instincts.
Imagine this. You're fighting a swarm of droolin' aliens. You have a choice between an advanced AKzVROOMzerg 19281 rifle with 1029 technicolored (and beautifully gradient) buttons you don't understand but can wipe out 200 aliens in one blow.
Or an old used knife purchased in eBay.
If aliens are miles away you might try fidgeting with the rifle.
Read the effin' manuals perhaps.
But if the aliens are just three feet away you'd grab the knife.
Instincts dictate you do do so.
(I know humans learn something from watching Rambo films. (Charlie Sheen spoof film included.))
FoxPro is that knife.
Going back to that project and aliens aside, I did retain the structure of the old databases.
Besides it contains a lot of data already.
I carefully imported them into independent FoxPro tables.
Fast forward to June 2007 and 8 clients later... I've decided it's about time for an upgrade.
There were of course updates... fixes and all on version 1.00 but I want a major change.
Including a rehaul of those imported databases.
A complete restructure from top to bottom.
I don't feel like I'm that ultra-bionic coder anymore but I did learn a lot.
Slashing instincts are still there though.
Plus we have new coding conventions.
And qs and I (who now codes with me (sometimes codes more than me)) have developed new engines. New frameworks.
(With new bugs. More advanced bugs. Bugs unseen to the naked user's eye.)
So I started coding and restructuring. Laughing in between at old funny codes and flows.
Mid-August a client asked for a feature. A needed feature.
Thinking it was just easy we accepted it.
I fired up two logs. One for version 1.00 and one for version 2.00 with a sub part in the old log that points out to 'codes/modules/forms modified in version 1.00 that are to be modified in version 2.00'.
Three months after I'm still working on that feature.
On both versions.
Pingpong-ing codes and chopped PRG files in between projects. A major change of database structure also made things harder. Think of the buffered variable names and flows I have to store in my mind to accomodate simultaneous processes.
Plus I'm already used to the new framework/engine of ours that uses a common library/codes folder. Much easier for lazy coders like me.
And I'm older now.
I'm older and unfocused.
And more whiny.