47
6502
12d

Previous developers read entire result of a SELECT into array of arrays.

Then used that later on in the following fashion.

print "name: " + result[row][17]
print "address: " + result[row][23]
...
without any description whatsoever what the numbers mean.

And it's here "result" and "row", in the actual code it was "arr" and "ii".

And these arrays were "public static" used everywhere, but initialized only at few places, so if you went onto wrong screen or if there was a phone call that kicked the app out it crashed.

But real fun began when people started changing queries and altering tables...

I seriously thought I was being pranked as a new hire.

Comments
  • 8
    I will pray for you 😔
  • 3
    for keeping a list of customers with associated data in local memory it's not all bad...

    well it is if it isn't documented, and it'd still be a lot better if it was a list<customer> or somesuch instead. the initializations also sound wonky, as does changing calls and tables instead of making new ones or operating around the existing tables in other ways...

    very funky overall. you still there?
  • 4
    Godspeed
  • 4
    @ArcaneEye In fact, I still am and it's not that bad.

    After persistence of these arrays in memory was resolved so app doesn't crash randomly, there was a grousome task of fixing all of the magic number references everywhere and making them be in sync with queries.

    App depended on things like "show map at (value[13], value[14]) which worked most of the time, but sometimes crashed when a string value came in for that field, or it worked incorrectly when a number of a different kind was there instead of lat or long.

    Those were really unpleasant 2 months, however app became stable enough to ensure further biz financing, at which point we discarded all of it and rewrote the whole damn thing from scratch.
  • 3
    @6502 well i guess congratulations are in order :)

    all 16 hours "clean coding with uncle bob" should be mandatory for anyone working with code... the things we woulden't have to deal with if people _cared_...
  • 1
    I find "result" the single laziest variable name anyone can use.
  • 0
    Please use %s ...
Your Job Suck?
Get a Better Job
Add Comment