It might break something



  • Our system has devolved into an anti-pattern rich decapsulated steaming pile of WTF.

    For every major thing that I fix to stabilize the system, 30 junior offshore developers manage to create 300 small WTFs that undermine the new-found stability.

    Today, I was asked to load and pass a new attribute around the system. Since this attribute is common to just about everything, one would think it'd be simple: just stick it in the base class. All I'd have to do is modify the underlying base query to include the field, and the base class method that reads the result set to grab and store the value, before calling the subclass methods to deal with the rest of the data.

    Right?

    Wrong!

    So far, I've found 68 (yes, sixty eight) separate classes, caches, wrappers, sub-wrappers, helpers and assorted code inlined where it doesn't belong - each duplicating the exact same action, but occasionally in slightly different ways.

    I made a detailed list of all of it, including the special case behaviors that would go in optionally overridden methods and proposed to clean it all up, so that next time, nobody would have to waste two weeks finding, changing, and testing 68(+) different versions of the same code to do the same thing. It'd just be in one place and a ten minute change.

    What if you make a mistake in refactoring? It might break something!

    Um, as opposed to risking breaking any combination of 68(+) different things every time there's a related change?

    No, you better not; it might break something!

    There are two more add-this-field tasks on the schedule between now and the end of the year (I'm not allowed to combine the three tasks because they are under separate billing sub-accounts, even though it would save a LOT of time).

    The overtime from this is going to fund my holiday shopping this year :)

     



  • @snoofle said:

    The overtime from this is going to fund my holiday shopping this year :)

     

    How do you manage to get paid overtime? Aren't you exempt?



  • What we call "overtime" is the same amount that he receives "over a (short) period of time".



  • Look on the bright side - as long as you're not doing that thing that might break something, none of what you do will need testing. That should save loads of time.



  • @russ0519 said:

    How do you manage to get paid overtime? Aren't you exempt?
     

    No, I'm an hourly consultant.

    Don't get me wrong; I try to do things in a cost effective way; I'm not trying to run up a bill, and they know that. But when they force me to work in the most inefficient way possible, they do pay for it.



  • @flabdablet said:

    Look on the bright side - as long as you're not doing that thing that might break something, none of what you do will need testing. That should save loads of time.
    Not sure if you were being sarcastic... What they're worried about me breaking is the 68 instances as part of refactoring. I'm still changing all 68 instances of the duplicated code as part of the scheduled change, so the risk of breaking something is there either way. However, refactoring would eliminate 67/68 of the risk going forward.



  • I am just glad it was not 69, dhromed would have jumped on top of that one.



  • A decent set of unit tests would alleviate the fear.

    But you knew that didn't you?



  • @snoofle said:

    What if you make a mistake in refactoring? It might break something!

    Is there no version control?

    @snoofle said:

    The overtime from this is going to fund my holiday shopping this year :)

    Oh, well, sounds like you've got everything under control and income security to boot then. :)



  • @Anketam said:

    I am just glad it was not 69, dhromed would have jumped on top of that one.
     

    And made it 699?

     



  • @SteamBoat said:

    A decent set of unit tests would alleviate the fear.

    But you knew that didn't you?
    Yes I did, and I'm working on it, but currently, only 2-3% of the app is covered by unit tests, and I can only write them in my spare time.

    I suppose I *could* stop posting here and spend the time writing unit tests, but where's the fun in that?

     



  • @Delve said:

    Is there no version control?
    Yes there is. However, this does not factor into the risk-averse-yet-creating-more-risk mentality.

     



  • @SteamBoat said:

    A decent set of unit tests would alleviate the fear.

    Supposing someone can write a good set of unit tests that tests the behavior of all 68 classes. And supposing these classes are uncoupled from the rest of the system.



  • @snoofle said:

    Yes there is. However, this does not factor into the risk-averse-yet-creating-more-risk mentality.

    "Stay out of that frying pan, you might get burnt."



  • @snoofle said:

    I'm an hourly consultant.
     

    That's what they call them these days? I've only just become accustomed to calling them "Streetwalker".



  • @Cassidy said:

    @snoofle said:

    I'm an hourly consultant.
     

    That's what they call them these days? I've only just become accustomed to calling them "Streetwalker".

    This term becomes more valid when you think of recruiters as pimps.



  • @snoofle said:

    Not sure if you were being sarcastic...

    Goodness me! So I was. Not at your expense, though. Just thought I'd try on your org's cultural attitude and see how it felt.

    It's warm and kind of familiar, but it smells bad.



  • @flabdablet said:

    It's warm and kind of familiar, but it smells bad.
     

    I know that feel bro.



  • @snoofle said:

    anti-pattern-rich decapsulated steaming pile of WTF

    I hope I never, [u]ever[/u], need to use this phrase. But if I do ever find myself in a situation where it is appropriate, I now know exactly what to say. Thanks!



  • @dhromed said:

    @flabdablet said:

    It's warm and kind of familiar, but it smells bad.
     

    I know that feel bro.

     

    It's familiar to many of us.

    Be thankful that we can recognise the sensations and address it before it's too late. Others will be too naive to know it's happening, or - worse still - actually bring it about, the fucktards.

     



  • Why pay for seatbelts when you can make the windshield more solid?



  • @TehFreek said:

    Why pay for seatbelts when you can make the windshield more solid?

    My first car had a metal dashboard and no seat belts.

    No, I'm not (quite) that old, but my car was (1964 Chevy El Camino).


Log in to reply