Ethics of intentional WTFing?



  • I was asked by my team lead yesterday to modify a module that I'm not even supposed to be working on. We use a number of lookup files to filter data and he wanted me to add another one, but the problem is that our lookup files are partitioned n-way (and processed n-way), and in order to do a lookup the lookup file has to be partitioned on the same key as the data you are filtering. The lookup file he asked me to add was partitioned on another key. Knowing that this would fail in an random, insidious manner, but also not wanting to get into a long argument about it, I pondered what to do. I almost tried to do the following.

     The first two lookups are already existing and use lookup files partitioned on key1. I'm trying to figure out how to avoid adding the third lookup, which is partitioned on key2.

    lookup_match("lookup file 1", key1)

    || lookup_match("lookup file 2", key1)

    /* This line added per team lead recommendation <font color="red">*\</font>

    || lookup_match("lookup file 3", key2)

    /* This line added per team lead recommendation */

    This isn't C -- its a proprietary language -- so the syntax is a little weird. This code gets embedded into a pre-made filtering component, so imagine that the whole thing is wrapped in an if statement. If the condition here is true (i.e. key is found in all lookup files), the record is passed through, otherwise it gets dropped into a reject file. The comment syntax is the same as C, however.

    The team lead uses a really basic text editor to view code, so there is no syntax coloring. He can also barely read or type, so I'm 99% sure that this would never get caught. Plus it looks innocent, right?

    I finally decided that it's too devious, and that WTFs should be used for good (if thats possible) and not for evil (which is the de facto). I ended up deleting the third condition and checking it in without it. Odds are 50/50 that either the team lead never looks at it again or we have an argument which I end up winning anyway because he was the module's designer and this is just one of many major flubs that he made in the design.

     

    Moderator's note: emphasis added 



  • @savar said:

    Moderator's note: emphasis added 

    There's a moderator?



  • @rbowes said:

    @savar said:

    Moderator's note: emphasis added 

    There's a moderator?

    Weird, I guess nobody ever posted anything word mod-ding before...anyway part of the fun is to stare for a minute and say "what's he doing here?" and then see it and go "wow, WTF?"



  • @rbowes said:

    @savar said:

    Moderator's note: emphasis added 

    There's a moderator?

     And there was emphasis added?  I sure don't see it.

     -- Seejay



  • @seejay said:

    @rbowes said:
    @savar said:

    Moderator's note: emphasis added 

    There's a moderator?

     And there was emphasis added?  I sure don't see it.

     -- Seejay

    I almost posted the same thing.  Then I finally noticed the "backwards" end-comment.  Presumably the red coloring is the added emphasis.

    Personally I would have gone with a space between the * and /, although with a fixed-width font that might be more noticeable.  Probably wiser not to add it to begin with, lest another "helpful" developer who does have syntax coloring comes along and "fixes" it...

     



  • Hey moderator! you suck!

     
    Moderator's note:  Your account is terminated! Sucker

     



  • g



  • I think highlighting the comment-thingy (I'm tired...) made it too obvious and ruined the challenge of spotting the WTF.

     

     

    Moderator's Note:  Account Terminated. What did I tell you about thinking?



  • @Control_Alt_Kaboom said:

    I think highlighting the comment-thingy (I'm tired...) made it too obvious and ruined the challenge of spotting the WTF.

    I think too many of us would not have spotted it at all.

    Moderator's note: Hey, I'm a moderator, why should I mod myself?
     



  • I think the moderator should let us suffer on our own and mind his own damn business!

    Moderator's note: You're right, you're too awesome for me. You guys rock. Especially you.



  • What's with all that "moderator" pseudonym stuff? Show yourself, coward!



  • There's a lot of moderating going on here.

    Cursive text.
     



  • @luketheduke said:

    What's with all that "moderator" pseudonym stuff? Show yourself, coward!


    Do you feel lucky, punk? 



  • Sweet.

     Moderator's note: moderator notes can easily be faked

    True, but the real mods can always set things right ;-)



  • So this is a good time to try that 'report abuse' link ?



  • @Storme said:

    So this is a good time to try that 'report abuse' link ?

    Probably. Anyway, moderators are already informed.



  • @ammoQ said:

    @Storme said:

    So this is a good time to try that 'report abuse' link ?

    Probably. Anyway, moderators are already informed.

    "Officer, I'd like to report a case of police brutality"

    "We already know."  smash



  • @dhromed said:

    @ammoQ said:

    @Storme said:

    So this is a good time to try that 'report abuse' link ?

    Probably. Anyway, moderators are already informed.

    "Officer, I'd like to report a case of police brutality"

    "We already know."  smash

    eg 


Log in to reply