• (cs)

    I registered now. Ha ha

  • airdrik (unregistered) in reply to Meme Responder
    Meme Responder:
    boog:
    Nagesh Kukunoor (unregistered):
    2011-01-31 11:10
    Nagesh Kukunoor (unregistered):
    Nagesh Kukunoor (unregistered):
    TRWTF is that if he had simply used simple stored procedure, he would have save even more time.
    I did not post this comment. Someone out here is mkaing fun of me.
    

    I did not here either. Must be another with same surname?

    Power Troll (unregistered):
    2011-01-31 11:11
    Nagesh Kukunoor (unregistered):
    boog (unregistered):
    Nagesh Kukunoor (unregistered):
    Did they find the original programmer who wrote that logic?
        I'm pretty sure I strangled him with a penguin before he made it out the door.
    
    Did he sue you afterwards?

    Fake frits just can't help himself: he invented yet another altar-ego.

    1-minute difference...same guy?

    This comment is 14 inches deep!
    And with any luck, it'll be 14 quote-levels deep!
  • (cs)

    BRAAAAAM If you see that your task becomes a 14 layers deep loop - or similar monstrous pattern, the first thing to ask yourself is - "am I taking the right approach?" and answer immediately with a "no."

  • (cs) in reply to Bumble Bee Tuna
    Bumble Bee Tuna:
    Clearly, TRWTF is that Chris didn't save his fix and dole it out slowly over a year. Imagine if every month he removed just one for loop and slightly expanded the SQL? Instead he blew his wad on a single fix! Amateur.
    It didn't say he was a contractor!
  • Nagesh Kukunoor (unregistered) in reply to Nagesh
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?
  • Terry (unregistered) in reply to henke37
    henke37:
    Sadly it's not always an option to use sql when the data is stored in memory in a structure like this.
    Oh, that's an easy one. Just create temporary tables as needed and dump the memory structure to database.

    Unless of course your on an embedded system with no database. Even so, there's probably an open source library to create a fake in-memory-only database and query that, but why bother when you could write your own in six weeks?

    Did I miss anything? Oh yeah, Grow up, Darth Irish Girl.

  • (cs) in reply to Nagesh Kukunoor
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?

    तुम खुद को ज्यादा शहाणा समाज रहेला है क्या?

  • david (unregistered)

    I did almost exactly the same thing at my last job. Fortunately for me the previous code had been written by an Oracle consultant who cost four times my rate and took four times as long to write the original report as I took to rewrite it ... so nobody had any particular affection for my predecessor. I got a raise and his contract wasn't renewed.

    Captcha: "appellatio" ... I'm not even going to go there.

  • Kang (unregistered)

    I have seen ABAP code very similar in general structure to that in SAP. And I'm not talking about what some junior ABAPer did--I'm talking about SAP-created functions.

    Loops within loops--and functions within those inner loops--and inside those functions--more loops. I am not making this up. And before Google-Translate it was almost impossible to decipher the sparse German comments that tried to explain the madness.

    I bring this up because I too often hear about the 'glory' of SAP and how some people think it's some sort of mecca system for n-tier development. It's one of the most ugly things you could ever want to see once you get under the hood. --Kang

  • Valczir (unregistered) in reply to SCSimmons
    SCSimmons:
    Scott:
    Of course, it would be surprising if management figured out how to test the new report to make sure it's correct. I'm sure someone complained that it didn't match the old report.
    No doubt. The struggles with answering those complainers are never-ending. "I don't think this report is correct." "Here's the documentation of exactly where all of the numbers on it come from." "I can't figure that stuff out, but I just don't think the report is right." "Why not?" "Well, it doesn't match the numbers on this other report." "Where do the numbers on that report come from?" "I don't know." "Then what makes you think those numbers are correct?" "We've been using that report for years! It must be right!" "I have another theory. It's that you've been managing to inaccurate data for years and never noticed." "You're not a team player." :(

    Hello? What? Well if you can't work as a team you're all fired. That's it, you heard me, fired! Get your things and go.

    Hello, security? Everyone on floor 4 is fired. Escort them from the premises. And do it as a team. Remember, you're a team and if you can't act as a team, you're fired too.

    Dom, get on to recruitment. Get them to look for a security team that can work as a team. They may have to escort the current security team from the building for not acting like a team.

    Team! Team, team, team, team, team. I even love saying the word 'team'. You probably think this is a picture of my family? No! It's a picture of The A-Team. Bodie, Doyle, Tiger, the Jewellery Man.

  • Nagesh Kukunoor (unregistered) in reply to Nagesh
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?

    तुम खुद को ज्यादा शहाणा समाज रहेला है क्या?

    खुददा?? शहाणा, तुम खुद को ज्यादा शहाणा! रहेला है क्यासतुम खुद को ज्यादा शहाणा समाज रहेला है. क्याज रहेला है क्या? खुद दा शहा!!!!!!
  • (cs) in reply to Nagesh Kukunoor
    Nagesh Kukunoor:
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?

    तुम खुद को ज्यादा शहाणा समाज रहेला है क्या?

    खुददा?? शहाणा, तुम खुद को ज्यादा शहाणा! रहेला है क्यासतुम खुद को ज्यादा शहाणा समाज रहेला है. क्याज रहेला है क्या? खुद दा शहा!!!!!!

    That made no sense at all! You fail.

  • (cs)

    I myself am guilty. I've written a kind of for loop over a lot of Articles and places. It has run fast here, but at the customer site it was terrible. I was so disappointed with it that I had to fix it. And after a few rounds of "wrong-doing" I got it. Runtime down from a few minutes to 10 seconds or so. It could be a bit better with better SQL, but it's currently good enough for a one-timeer ;-(

  • qbolec (unregistered)

    How exactly do you replace a logic that iterates over tables, rows and columns, with a join?

  • Nagesh Kukunoor (unregistered) in reply to Nagesh
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?

    तुम खुद को ज्यादा शहाणा समाज रहेला है क्या?

    खुददा?? शहाणा, तुम खुद को ज्यादा शहाणा! रहेला है क्यासतुम खुद को ज्यादा शहाणा समाज रहेला है. क्याज रहेला है क्या? खुद दा शहा!!!!!!

    That made no sense at all! You fail.

    It made no sense because you cannot read Hindi. So my point is proven, you are imposter.

  • (cs)

    Yo dawg, I herd u liek loops so I put a loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop inside ur loop so u can loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop while u loop.

    In other news, I herd u liek copypasta...

  • backForMore (unregistered) in reply to qbolec

    wow,just wow, put down the keyboard and go back to making my burger. I will take a liter of cola with that.

  • Anonymous Anonymous (unregistered) in reply to Nagesh
    Nagesh:
    I registered now. Ha ha

    Thanks for sharing.

  • Henning Makholm (unregistered) in reply to qbolec
    qbolec:
    How exactly do you replace a logic that iterates over tables, rows and columns, with a join?
    The code does not quite look like it is database tables etc. it loops over. The general ineptness of it all makes it plausible that _dbConnector.UpdateAgentList() et al. each retrieves just a linear set of strings, but then helpfully formats it as a sequence of two-dimensional tables for easy printing!
  • (cs) in reply to Anonymous Anonymous
    Anonymous Anonymous:
    Nagesh:
    I registered now. Ha ha

    Thanks for sharing.

    U R WC

  • Luc (unregistered) in reply to dgvid

    Optimator is a German Beer..

  • (cs) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    What I want to know is how do you make time to refactor code like this? Every job I have worked at has always kept us developers swamped with "new" work and we are never allocated time to go back and fix things as the rule is "There is ALWAYS something to do"

    My current job could do with a fair bit of code cleanup but there is no time allocated. Should I pretend to take longer on other assigned tasks and use that time to refactor some code or develop a proof of concept to demonstrate how some things can be done better than they are currently?

    Yes, to the question in bold.

  • Luc (unregistered) in reply to dgvid
    dgvid:
    Zen Grasshopper:
    Premature optimization? Don't they have a medication for that?

    Ask your doctor if Optimator is right for you. And remember, IT advice should be sought immediately for report generation lasting more than four hours.

    Optimator Is a German Beer... hehehe

  • Robb (unregistered) in reply to Anonymous
    Anonymous:
    Holy crap, it's like a taco inside a taco inside a Taco Bell inside a KFC in a mall in your dream!

    +1 for the insheeption reference

  • The Real Nagesh Kukunoor (unregistered) in reply to Nagesh Kukunoor
    Nagesh Kukunoor:
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?

    तुम खुद को ज्यादा शहाणा समाज रहेला है क्या?

    खुददा?? शहाणा, तुम खुद को ज्यादा शहाणा! रहेला है क्यासतुम खुद को ज्यादा शहाणा समाज रहेला है. क्याज रहेला है क्या? खुद दा शहा!!!!!!

    That made no sense at all! You fail.

    It made no sense because you cannot read Hindi. So my point is proven, you are imposter.

    Hai guys! What are you doing? Quit fighting over my name!

  • (cs) in reply to Natural Born Complainer
    Natural Born Complainer:
    Oh, and their "caching" solution, of fetching an arbitrary amount of records before and after the requested one, just in case...
    A slightly-reasonable idea with an undoubtedly WTF architecture behind it. Yay.
  • (cs) in reply to The Real Nagesh Kukunoor
    The Real Nagesh Kukunoor:
    Nagesh Kukunoor:
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?

    तुम खुद को ज्यादा शहाणा समाज रहेला है क्या?

    खुददा?? शहाणा, तुम खुद को ज्यादा शहाणा! रहेला है क्यासतुम खुद को ज्यादा शहाणा समाज रहेला है. क्याज रहेला है क्या? खुद दा शहा!!!!!!

    That made no sense at all! You fail.

    It made no sense because you cannot read Hindi. So my point is proven, you are imposter.

    Hai guys! What are you doing? Quit fighting over my name!

    Troll Wars!

  • (cs) in reply to Robb
    Robb:
    Anonymous:
    Holy crap, it's like a taco inside a taco inside a Taco Bell inside a KFC in a mall in your dream!

    +1 for the insheeption reference

    +5 for being a South Park fan.

  • Collarstains (unregistered)

    He should have taken the opportunity to create a Speedup Loop to ensure that these "accolades" keep showering down with every revision.

  • (cs) in reply to 3rd Ferguson
    3rd Ferguson:
    ...queries their queues...
    ...queries their queues...

    Hmm...

    A quarrelsome quest for questionable queries! A quotidian quagmire quickly makes quad-cores querulous. But quality code quashes quackery.

    Let's quit and quaff!

    /14 layers of queues?

    Requisite XKCD: http://xkcd.com/853/

  • (cs) in reply to Safely anonymous
    Safely anonymous:
    Ken B.:
    TRWTF is that you think we'd believe that management would do such a thing.

    Nah, it happens. (It helps if the previous programmer isn't around anymore, though.)

    ObiWayneKenobi:
    What I want to know is how do you make time to refactor code like this? Every job I have worked at has always kept us developers swamped with "new" work and we are never allocated time to go back and fix things as the rule is "There is ALWAYS something to do"

    The trick is to make the fix the "new work". Get the people who use that report to send a request up the line asking if there's any way to make the report run faster. Get them to mention how much time/money/hassle they will save if the report was better. Cc liberally.

    +10 for knowing how IT office politics works

  • Gary Olson (unregistered)

    each layer has and odd mesmerizing 4/10 type of beat if you read the lines out loud. Until that last foreach statement where he just destroys the whole rhythm.

  • Delicious pie is delicious. (unregistered) in reply to imgx64
    imgx64:
    Electro Protonucleus:
    Ken B.:
    Thrilled to have such tangible, immediate results at their fingertips, management showered Chris with accolades galore.
    TRWTF is that you think we'd believe that management would do such a thing.

    Actually, they reprimanded him for making $BOSS->$BOSS->Offspring[1] (aka "the brilliant programmer who wrote the original code") look bad.

    TRWTF is the programming language you seem to be using.

    This is either Perl (which I don't know much about) or PHP (which I used before it got all this fancy OO stuff). Either way, I don't think the second $BOSS should have $, but I could be wrong.

    That I haven't really used Perl in several years, and remember the parsing rules this well says a lot about the language...

    I think Perl would interpret it as:

    $BOSS->&$BOSS()->Offspring()->[1]

    So, given a reference to the object $BOSS...

    Find a method named $BOSS, call it with no arguments...

    Call the method Offspring() on that returned value...

    Get the 2nd item from the returned list.

    I think the overload module lets you override how an object stringifies, so this isn't entirely unrealistic.

  • FuBar (unregistered) in reply to frits
    frits:
    Is this some of that new-fangled "No SQL" stuff?
    Those who do not learn set theory are condemed to slow reports. (Apologies to George Santayana.)
  • (cs) in reply to Nagesh Kukunoor
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?
    To be as irritating as possible, obviously. If you want him to stop, it's important to demonstrate to him as much and as often as possible how much it annoys you.
  • (cs) in reply to FuBar
    FuBar:
    frits:
    Is this some of that new-fangled "No SQL" stuff?
    Those who do not learn set theory are condemed to slow reports. (Apologies to George Santayana.)
    Featured Comment!
  • (cs) in reply to hoodaticus
    hoodaticus:
    Nagesh Kukunoor:
    Nagesh:
    I registered now. Ha ha
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?
    To be as irritating as possible, obviously. If you want him to stop, it's important to demonstrate to him as much and as often as possible how much it annoys you.

    XD That's terrible.

  • (cs)

    Impressive. Typically, my queries only go 8 or 9 layers deep.

  • (cs) in reply to Power Troll
    Power Troll:
    Impressive. Typically, my queries only go 8 or 9 layers deep.

    WTF? I don't think that it is necessary to go that deep.

  • (cs) in reply to hoodaticus
    hoodaticus:
    Nagesh Kukunoor:
    Why do you register my name? I see you try to impersonate me but for what reason do you do this?
    To be as irritating as possible, obviously. If you want him to stop, it's important to demonstrate to him as much and as often as possible how much it annoys you.
    Of course; it's just like grade school. Kids never pick on each other if they know it hurts the other kid's feelings.
  • rfoxmich (unregistered)

    If they ever go back to putting the data in a flat file, he's screwed ;-)

  • (cs) in reply to Nagesh
    Nagesh:
    Power Troll:
    Impressive. Typically, my queries only go 8 or 9 layers deep.

    WTF? I don't think that it is necessary to go that deep.

    So let me get this straight. If someone named "Power Troll" trolls you, you still don't get it. No wonder you don't get the point of stored procedures. We could slap you in the face with it and it would go soaring right over your head.

  • Sectoid Dev (unregistered) in reply to Some Wonk

    During the verbal praise, management mispronounces your name or says the wrong department or job title.

    My 5 year service award indicated I had worked 17.5 years. I wonder if I could get that vacation time?

  • (cs) in reply to Lockwood
    Lockwood:
    Yo dawg I heard you liked foreach so I put a foreach in your foreach so you can foreach while you foreach

    Foreach is the new Smurf.

  • (cs) in reply to Sectoid Dev
    Sectoid Dev:
    During the verbal praise, management mispronounces your name or says the wrong department or job title.

    My 5 year service award indicated I had worked 17.5 years. I wonder if I could get that vacation time?

    You should try and get the vacation time.

    They did say you worked 17.5 years. And management never likes to admit that they were wrong.

  • Anon (unregistered) in reply to Scott
    Scott:
    What management would not want proper testing to show them that the end result is still the same?
    Actually, if the original report was reading the DB over an 8 hour period, they don't want the new report to be the same. The original report would have data skewed from agent to agent as their queues changed through the day. The new report should provide a more accurate snapshot.

    Of course, it would be surprising if management figured out how to test the new report to make sure it's correct. I'm sure someone complained that it didn't match the old report.

    Appleseed's stats are much better [or about the same, depending on the time]

    Buuuuut... zimbobway's stats are quite a bit worse!

  • Don L (unregistered)

    I'm ForEaching your ForEach. Pray I don't ForEach it any further....

    I'm amazed none of you guyz came up with that.... I mean with such a sh..load of ForEaches.... :)

  • (cs) in reply to ais523
    ais523:
    imgx64:
    This is either Perl (which I don't know much about) or PHP (which I used before it got all this fancy OO stuff). Either way, I don't think the second $BOSS should have $, but I could be wrong.
    It isn't valid Perl. Surprisingly, the second $BOSS is legal there, if $BOSS happens to be an object which stringises to a method that it has (e.g. strings aren't objects in Perl, but if they were, after 'my $BOSS = String->new("ucfirst");' you could do '$BOSS->$BOSS' and get "Ucfirst", although you'd need strict "refs" off to be allowed to even contemplate such a monstrosity); but the square brackets at the end are inconsistent with the syntax beforehand. It should either be "${$BOSS->$BOSS->Offspring}[1]", or the abbreviation "$BOSS->$BOSS->Offspring->[1]" in order to avoid a syntax error, and even then, you'd need a ridiculously contrived program for it to not just error out when executed, as well as turning strict mode off.
    Just to be evil (my name's not Google!):
    #!/usr/bin/env perl
    package Boss;
    use overload '""' => \&to_string;
    sub foo
    {
        my $this = shift;
        return $this->{foo};
    }
    sub new
    {
        my $class = shift;
        my $this = {
            foo => {
                Offspring => [
                    Offspring->new('First'),
                    Offspring->new('Second')
                ]
            }
        };
        bless $this, $class;
        return $this;
    }
    sub to_string
    {
        return 'foo';
    }
    package Offspring;
    use overload '""' => \&to_string;
    sub new
    {
        my $class = shift;
        my $this = {
            name => shift
        };
        bless $this, $class;
        return $this;
    }
    sub to_string
    {
        my $this = shift;
        return "{name => '$this->{name}'}";
    }
    package main;
    my $BOSS = Boss->new;
    my $evil = $BOSS->$BOSS->{Offspring}[1]; # **********
    print "$evil\n";
    print "Thank you, and goodnight!\n";

    As you mentioned, it won't compile as was originally commented, and depends on strict vars being off, but a few braces and some poor programming practices fixes all of that. ;)

  • f. (unregistered)

    Show us your SQL or GTFO!

  • (cs) in reply to Don L
    Don L:
    I'm ForEaching your ForEach. Pray I don't ForEach it any further....

    I'm amazed none of you guyz came up with that.... I mean with such a sh..load of ForEaches.... :)

    I wonder just how many memes one could apply this to.

    the "y u no" guy: FOREACH Y U NO RUN QUICKLY

    Asian father: "Why do you foreach? You should for-H. Wait, no, you should foray."

    Paranoid Parrot: Foreaches keep looping back. They're stalking me.

    "I bet you can't run this foreach loop in less than a working day!" "CHALLENGE ACCEPTED."

    Manager troll: "If you want to make this run fast, just write it in half a page or less of code and run one of your compiler optimizer thingies. Then it will be condensed into less lines of code. Do this repeatedly until you have 0 lines of code, and it will run instantly. Problem time complexity? You jelly?"

    etc. etc.

Leave a comment on “14 Layers Deep”

Log In or post as a guest

Replying to comment #:

« Return to Article