Offshore "Talent"



  • Our system is fed xml-format records, via MQ, from several systems. We store it, crunch it, and forward it on. While creating some automated tests, I needed to create a filter that transforms data records from internal-db-format to xml so that they can be fed into an automated test to simulate data coming from the systems that feed ours. Naturally, there is a library of code that does these sorts of transformations, so I should simply call it, right? Not quite...

    Cheap offshore "talent" was hired to save costs. Of course, each time they needed to do this type of task, they wrote a new variant of the original code, with xml dtd/schemas sufficently different that any given copy of the library would only work with one version of the schema, and by extension, one version of the client-library. Did they try to parameterize the methods? Nope. Did they try to make use of common code in the form of simple static methods? Did they even name the f*g classes/methods coherently? Nope. Cut-n-paste, everywhere!

    I come along, blissfully unaware, search for the library, find it and use it. All seems to work well between me and the api. Then I try to unwrap the xml at the other end. Whoops; incompatible dtd/schema. Grrr. Now I'm in search-mode, and find all the different variants. Six in all. In different projects scattered throughout the entire source tree. They are numbered as: Item1.java, Item6.java (at least Transformer_n.java might have been more useful). To add insult to injury, the latest one didn't have the highest version number (they still can't explain that one to me).

    Slash-n-burn; refactor, refactor, refactor, fix all code that references any of it so it's all consistent, test, test, test, check in ONE copy of code, delete all others.

    The next day, I get a call from the head-of-offshore-talent demanding to know why I refactored perfectly good code. Um, to get rid of the dead code that should no longer be used? To eliminate the possibility of anyone inadvertently using/changing the wrong (e.g.: not the latest) version of the library? To name the classes for what they do so someone else can understand?

    The putz pushed it to management. I justified it, and they were ordered to learn how to do things properly.

    TRWTF is our management, because they STILL insist that it's cheaper to use these yahoos...

    </rant>



  • Congrats on at least convincing management that those yahoos' code needed refractoring.

     

    How much time was spent by you making this change? How much time do you think another Transformer would take you to write? How much cost is it for the yahoos to do it. If them doing it, then you fixing it is cheaper, management wins, you just rip a few hairs out.

     

    Whats funny is that your management does not realize that the offshore manager wanted to entrench himself with this horrible code and you might have just undone month's of his work.



  •  Glad to see someone step up for a change.  I'm surprised this wasn't met with responses like "give your two weeks notice" or "get out now!".



  • @dlikhten said:

    Whats funny is that your management does not realize that the offshore manager wanted to entrench himself with this horrible code and you might have just undone month's of his work.
     

     

    This guy put it best:  "I enjoy handing over the ammo."

     



  • Refactor? That's crazy talk.  Real men have at least 5 different versions of any one file. They know which one to use by some arbitrary naming convention known to them and them alone. Needless to say documentation and comments are for wimps. And so is backwards compatibility. Don't you know how much trouble Microsoft has to make Windows backwards compatible?

    (Note for sad, sad people: the above is widely known as sarcasm) 



  • @dlikhten said:

    How much time was spent by you making this change?

    The transformer itself took about 2 hours to write and debug. Finding all the debris and refactoring took about 2 days. According to the change control logs, the offshore guys spent a total of 26 man-days creating/editing all that code.

    I will grant you that I make a good buck, but I sincerely doubt that I make 13 times as much as these guys, let alone 104 times as much...

    *sad*


Log in to reply