• Design Pattern (unregistered) in reply to Adolf
    Adolf:
    Hi, IBM? Yeah, it's me, Hitler. Soo.. I need to find all of the Jews, you know, from everywhere. I have a big truck filled with .. uh.. ice cream? Yeah, ice cream. So I need to find every Jew. So I can give them some ice cream. Can you do it for a disproportionately massive amount of bloo.. erm.. honest currency? Uh-huh. Uh-huh. Heil to you too. Buh-bye,
    So you raised the value of the Reichsmark from 1933: 1 USD=RM3.28 to 1 USD=2.50RM in 1939, 1940 and 1941 and were not even aware of it?
  • D (unregistered) in reply to Crash Magnet

    Har, this is a WTF entry in itself. Such sh**ty coding Crash Marnet

  • Friedrich (unregistered)

    I'm not able to belief that. I've seen my share of C&P code but this is beyond everything I've seen before....

  • Pedro (unregistered) in reply to luis.espinal
    luis.espinal:
    Pedro:
    I don't see what all the fuss is about. The person who wrote it probably hated it also. The irony of 'business logic' is that it's anything but logical, and that is hardly ever the fault of the developer.

    That said, what a maintenance nightmare.

    You don't see what the fuss is all about (even though you actually realize it is a maintenance nightmare)?

    The WTFery here has nothing to do with convoluted business rules, and everything to do with lack of the most basic of logical skills. This ain't rocket science, but simple software eng 101.

    Look, the SOD sample below contains repetitive statements and computations (in color for ease of identification):

    if ((    (DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"])) 
                   < DateTime.Parse("01.01.2005"))
          && ((T012_lbl_AenderungVorsteuer100EUR >= 250) 
               || (T012_lbl_AenderungVorsteuer100EUR <= -250))
          && ((DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"])) 
                   <= DateTime.Parse(T012_lbl_Berichtigungszeitraum_Ende.Text))
    	   || (T012_lbl_Berichtigungszeitraum_Ende.Text == ""))
          && ((GetRoundedDate(DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"]))) 
                   <= DateTime.Parse(T012_lbl_Berichtigungszeitraum_Ende.Text)) 
    	   || T012_lbl_Berichtigungszeitraum_Ende.Text == "")
          && ((GetRoundedDate(DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"]))) 
                   > DateTime.Parse(T012_lbl_Berichtigungszeitraum_Anfang.Text)) 
    	   || (T012_lbl_Berichtigungszeitraum_Anfang.Text == ""))
        ) || (
             (DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"])) 
    	       >= DateTime.Parse("01.01.2005"))
    

    In particular, the following evaluation occurs multiple times in every clause separated by an OR operator:

    (DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"])) 
    	       >= DateTime.Parse("01.01.2005"))

    Why would someone compute, re-compute, and uber-re-compute the exact same string date parsing operation and comparison (both of which are invariant)?

    Ignoring the expense of such a ridiculous thing, why do it? Why not refactor it? Why not normalizing that damned gigantic OR clause?

    Not only does this become a run-time expensive maintenance nightmare, it also fails at giving a reasonable (and maintainable) representation of business logic.

    There is madness (some of) in business logic. It is a given. It is our job to represent that madness (which many times it isn't even there to complain to begin with) with reasonable software constructs.

    Regardless of what many people would like to think, bad software (specially utterly hideous bad software) is ultimately our responsibility, our fault, not a fault generated by faults in underlying business logic.

    Blaming almost everything in supposedly faulty business logic is a cliche long worn out.

    Poor Luis. Absolutely right but totally wrong all at the same time.

    We care about a few cycles lost to a repetitive conditional check? Really? Oh no .. so scary. If you did the decompose conditional refactoring it would make it easier to read, and that's probably the best piece of advice.

    The system also appears like it doesn't have a good test suite. I've worked on lots of code like that where dev's are worried about fixing odd conditionals because you don't want to break anything. A nightmare butterfly effect.

    Oh well, at least your chest-thumping made you feel good for a while.

    manana

  • bla (unregistered)

    Clearly should have used a ternary expression.

  • trwtf (unregistered) in reply to frits
    frits:
    TrXtR:
    Hey guys! See lotsa activity here, sorry for only posting now! Was kinda busy getting LAID last night...

    Does that make me a troll?

    OK...So what did you do for the other 23 hours and 58 minutes of your day?

    Hate to tell you this, frits, but... you're doing it wrong.

  • Sudo (unregistered)

    TRWTF is that as soon as Germans are mentioned, certain people feel an overwhelming urge to shout something about Nazis... sigh

  • (cs) in reply to trwtf
    trwtf:
    frits:
    TrXtR:
    Hey guys! See lotsa activity here, sorry for only posting now! Was kinda busy getting LAID last night...

    Does that make me a troll?

    OK...So what did you do for the other 23 hours and 58 minutes of your day?

    Hate to tell you this, frits, but... you're doing it wrong.

    Butt it feels oh so right.

  • dev (unregistered) in reply to boog

    You're right. Table prefixes on fields are unnecessary... unless you: a) have more than 4 tables in your system. b) Need to use fancy stuff like "joins" and "views".

  • Luiz Felipe (unregistered) in reply to rnd * 1000
    rnd * 1000:
    JayC:
    rnd * 1000:
    Tim:
    rnd * 1000:
    The Article:
    Databases? Naaah... just use a bunch of XML (or sometimes CSV) files.
    Phillip needs to be drug out into the street and shot if he thinks there's a difference between XML and CSV. What does it matter what format it's saved in: it's read by Excel the same. And if that's how they want to manage their databases, what's wrong with that? It's a lot simpler and easier to understand than writing obtuse sequel statements on the command line. TRWTF is developers that think that everyone is as computer-savvy as they are.
    as someone who has worked with XML and CSV I can assure you there are plenty of differences. XML is a documented standard and had tools available which adhere to that standard. just try processing a CSV file containing non-ascii characters, whitespace, quotes, leading spaces, line breaks etc etc and see what I mean
    Try reading more dev magazines and less management books before you post here again, plz.

    Oh wow Rnd. XML is far better format than CSV for many circumstances. Maybe it's not for importing to excel, but for many OTHER circumstances. If you're only importing data into excel, yeah, maybe it's a WTF. I've yet to successfully import data in from a XML file to Excel, but I've yet to care to figure it out, either, since I've got a lot better tools than Excel to do most of what I need done.

    Well look who's jumped on the dummy bandwagon! Careful, or you push some of your cousins out!

    First of all, you don't "import" into Excel. You can just open the file. It's a native format. As a native format, you have to jump through hoops just to try to open it in, say, notepad. (Hint: don't try it or you'll see a bunch of rectangles.) As far as "better tools" go, I've tried Open "Ripoff" Office and only have one thing to say: why use an imitation when you can only count on it to display the file correctly half the time? Sure it works with some of the simpler documents, but if you're using formulas or formatting you might as well be playing Russian Roulette. And Google docs? Well, that doesn't work when you're trying to protect your data and not just have it posted on the internet. That's why we don't just use gmail for company business.

    See, I've been around the block a few times, and unlike you I actually know what I'm talking about: I'm not just speculating on something I read about in PC Magazine.

    This troll is only right in the fact tha Office is shit, but Open "Ripoff" Office is cube shit.

    OpenOffice CreateMoreShit () { return System.Math.Pow(Microsoft.Office, 3); }

    Captch Damnum, damnum you.

  • Luiz Felipe (unregistered) in reply to rnd * 1000
    rnd * 1000:
    JayC:
    rnd * 1000:
    Tim:
    rnd * 1000:
    The Article:
    Databases? Naaah... just use a bunch of XML (or sometimes CSV) files.
    Phillip needs to be drug out into the street and shot if he thinks there's a difference between XML and CSV. What does it matter what format it's saved in: it's read by Excel the same. And if that's how they want to manage their databases, what's wrong with that? It's a lot simpler and easier to understand than writing obtuse sequel statements on the command line. TRWTF is developers that think that everyone is as computer-savvy as they are.
    as someone who has worked with XML and CSV I can assure you there are plenty of differences. XML is a documented standard and had tools available which adhere to that standard. just try processing a CSV file containing non-ascii characters, whitespace, quotes, leading spaces, line breaks etc etc and see what I mean
    Try reading more dev magazines and less management books before you post here again, plz.

    Oh wow Rnd. XML is far better format than CSV for many circumstances. Maybe it's not for importing to excel, but for many OTHER circumstances. If you're only importing data into excel, yeah, maybe it's a WTF. I've yet to successfully import data in from a XML file to Excel, but I've yet to care to figure it out, either, since I've got a lot better tools than Excel to do most of what I need done.

    Well look who's jumped on the dummy bandwagon! Careful, or you push some of your cousins out!

    First of all, you don't "import" into Excel. You can just open the file. It's a native format. As a native format, you have to jump through hoops just to try to open it in, say, notepad. (Hint: don't try it or you'll see a bunch of rectangles.) As far as "better tools" go, I've tried Open "Ripoff" Office and only have one thing to say: why use an imitation when you can only count on it to display the file correctly half the time? Sure it works with some of the simpler documents, but if you're using formulas or formatting you might as well be playing Russian Roulette. And Google docs? Well, that doesn't work when you're trying to protect your data and not just have it posted on the internet. That's why we don't just use gmail for company business.

    See, I've been around the block a few times, and unlike you I actually know what I'm talking about: I'm not just speculating on something I read about in PC Magazine.

    This troll is only right in the fact tha Office is shit, but Open "Ripoff" Office is cube shit.

    OpenOffice CreateMoreShit () { return System.Math.Pow(Microsoft.Office, 3); }

    Captch Damnum, damnum you.

  • Luiz Felipe (unregistered) in reply to Penguin Parade
    Penguin Parade:
    Gunslinger:
    Bob:
    TRWTF is that Chrome decided to translate the page...

    And unwrapped the code to a single line, without adding a scrollbar...

    TRWTF is using Chrome...

    CAPTCHA: genitus - someone who uses Chrome, opposite of genius.

    Clearly you've never worked on a headless operating system.

    For the uninformed, a "headless" operating system is one that operates without the convenience of fancy windows and multiple colors. That's right: a real man's OS. It's just you and the keyboard, and you can put that mouse behind the tyre of your neighbors minivan because you won't be using it. How are you going to browse the web, use wget to pull the file and then ftp it to your backup headed OS? No way! A real man doesn't have a headed OS. Us real men use Chrome and view our web pages IN TEXT. No, I'm not talking about reading HTML tags: I'm talking about viewing web content as God intended it: pure text. In fact: I'm filling out this form on Chrome on my headless operating system right now.

    Now: sudo go get me a beer!

    No, headless operation system dont have text mode, you use the register switchs in front panel of computer to syscall the kernel using interrupt directly in the cpu. keyboard is for linux kids.

  • Luiz Felipe (unregistered) in reply to Ron
    Ron:
    A german *gasp*:
    If you buy something for 1000€+19%VAT (thus, 1190€)
    VAT is TRWTF. I mean, only 19 percent? Amateurs! Here in the States we pay over 40% of our income back in tax. It is like working every Monday and Friday for free.

    Look, let's just get taxes up to 100% and be done with it already. Then everything can be free and we can all get million dollar checks in the mail. Cancer will be cured, people can return to the moon to stay this time, and I'll finally get my flying car dammit!

    Here in brazil we pay 60% in every product we buy. The producer pay for it when they sell, and the transporter pay twice, then the reseller pay something called tributary substitution, then you pay only 18%. But you pay 25% of your salary in income tax if you make more than 2k. But you have to remember that some products will be selled without fiscal document and will not pay the tax. for 10 product sold, only 2 or 3 pay tax. Its only by this that economic can run without colapse by governement taxes.

  • Sylver (unregistered) in reply to Matt Westwood
    Matt Westwood:
    ...

    Sweden has some prisons that are extremely comfortable. When I'm tired of having to fend for myself I'm tempted to go to Sweden or order to jaywalk while drinking alcohol in public.

    That won't work, it's a national sport.

  • Anon (unregistered)

    Last week I sent this code to my cooworkers and we had quite the laugh. Today I found out that I'm working in the same department and company. Still funny though.

    thanks for the beer!

  • 2ti6x (unregistered)

    please, PLEASE don't tell me this is used in ELSTER?

  • Anone (unregistered) in reply to Max
    Max:
    LOL, your IE loads ten minutes? Mine is up and running in 2 seconds.

    He was probably thinking of Firefox.

  • datenwolf (unregistered) in reply to JB

    This piece of code seems to be related to german tax reporting, namely building the dataset submitted to the revenue office using the ELSTER protocol. So this code is tied closely to german tax laws, so it makes sense to name the variables the very same they are called in the law's text. All those variable names you can find in the german tax law.

  • Shinobu (unregistered) in reply to datenwolf

    Yes, but the repeated parses and duplicate logic generate a lot of line-noise that makes it very tedious to verify that the code does actually comply with the relevant legislation. Still, to call this a WTF is devaluing the word into meaninglessness.

  • M. Jagger (unregistered) in reply to frits
    frits:
    Now wait just a minute. You, Sir, have insulted my manhood! *removes glove* *SLAP!* I demand satisfaction!

    I wish you luck in attaining that, as when it comes to satisfaction, I for one can get none.

    Whether driving in my car, or when watching TV, or indeed even when riding round the world.

    It certainly isn't a lack of initiative on my part, for I try and I try and I try and I try. Despite that, it remains the case that I cannot gain satisfaction...

  • Alg0r1thm (unregistered) in reply to rnd * 1000

    TRWTF is that you just said "sequel" statements. You fail at criticism.

Leave a comment on “How the Big Companies Do It”

Log In or post as a guest

Replying to comment #:

« Return to Article