• NSFW (unregistered)

    +1 to anyone who can accurately summarize the business logic in 30 words or less.

  • (cs)

    Nein, nein, nein, nein!!!!! </adjust monocle></witch moustache>

  • Alargule (unregistered)

    Was zum Teufel!

  • (cs)

    Hear me know and believe me later, readability is for little baby losers.

  • sir_flexalot (unregistered)

    Looks pretty standard to me for a big company.

  • JB (unregistered)

    TRWTF is the German variable names. Everyone knows that English should be used.

    Captcha: consequat - I think I'm going to suffer them soon.

  • David (unregistered)

    I can summarize this business logic in one word, but it isn't a very polite one.

    I can also summarize it in 20 polite words, "a bunch of indecisive managers have been throwing different requirements at a team of overworked programmers for far too long."

  • Ken B. (unregistered) in reply to NSFW
    NSFW:
    +1 to anyone who can accurately summarize the business logic in 30 words or less.
    I could do it if it weren't for the fact that I've been mesmerized by das blinkenlights.

    Darn akismet, won't let me post as a URL.

    www.netlingo.com/word/das-blinkenlights.php

  • Rhywden (unregistered)

    Then again, if the softwar's got anything to do with the German tax code, I can see why it's that complicated.

    Fun fact: The German tax code is as large as ALL other countries' tax codes lumped together.

  • Anonymous (unregistered)

    TRWTF is German tax legislation.

  • EvenMoreAnonymous (unregistered) in reply to NSFW

    It's not that bad, actually. The entire first part reduces to pseudo-code of:

    if(t17Date < MaxDate(#1/1/2005#,ende,anfang) && Math.Abs(amount) > 250)

    The complication comes from parsing and converting the same text over and over rather than using locals and a few simple methods. Whoever posted this could have refactored it into something decent in less time than it took to write up the bogus framing story. (Then again, maybe not).

  • The Corrector (unregistered)
    The Article:
    "I recently was hired by a very large company government," writes Philipp B
    FTFY
  • anonymous coward (unregistered)
    DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"]))

    appears 27 times in the source.

  • Henning Makholm (unregistered) in reply to Rhywden
    Rhywden:
    Then again, if the softwar's got anything to do with the German tax code, I can see why it's _that_ complicated.
    This one is not all the tax code's fault.

    There are heaps of common subexpressions. For example, the same three date specifications are parsed upmteen times each, and comparisons between them repeated ad nausaeam. Apparently the developer has never head about using local variables to give names to meaningful intermediate results.

  • Bobbo (unregistered)

    Meine kopf ist kaputt.

  • My Name Is Missing (unregistered)

    Imagine if Hitler had used these guys; a lot more people would be alive today.

  • frits (unregistered) in reply to EvenMoreAnonymous
    boog:
    I'm pretty sure I would have strangled whoever wrote this.
    What are you, a moron? Have you ever visited a German prison? Its not pretty, let me tell you.
  • AnanabSemaj (unregistered)

    Ahha I see, TRWFT is that it should be inline yeah?

    :)

  • (cs)

    The bigger the company, the worse the code.

    • reads sample from article *

    Wow, I didn't realize your company was THAT big!

  • rnd * 1000 (unregistered)
    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.
  • Bob (unregistered)

    TRWTF is that Chrome decided to translate the page...

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

  • Crash Magnet (unregistered)

    a = (DateTime.Parse(Convert.ToString(table17["T017_txt_addChangeDate"])) b = DateTime.Parse("01.01.2005") c = T012_lbl_AenderungVorsteuer100EUR e = T012_lbl_Berichtigungszeitraum_Ende.Text g = T012_lbl_Berichtigungszeitraum_Anfang.Text h = T012_lbl_AenderungLaufJahrEUR p = T012_lbl_AenderungGanzesJahrEUR d = DateTime.Parse(e) f = DateTime.Parse(g) q = GetRoundedDate(a)

    flag = FALSE; if ((a < b) && ((c >= 250) || (c <= -250)) && (a <= d) || (e == "")) && ((q) <= d) || e == "") && ((q) > f) || (g == "")) flag = TRUE;

    if (a >= b) && ((c >= 1000) || (c <= -1000)) && (a <= d || e == "")) && ((q) <= d || e == "")) && ((q) >= f || g == "")) flag = TRUE

    if ((g == "") && a < b) && (c >= 250) flag = TRUE

    if (a < b) && ((h >= 250) || (h <= -250)) && (a <= d) || (e == "")) && ((q) <= d) || e == "") && ((q) > f) || (g == "")) flag = TRUE

    if (a >= b) && ((h >= 1000) || (h <= -1000)) && (a <= d || e == "")) && (q <= d || e == "")) && (q >= f || g == "")) flag = TRUE

    if ((g == "") && a < b) && (c >= 250)) flag = TRUE

    if (a < b) && ((p >= 250) || (p <= -250)) && (a <= d) || (e == "")) && ((q) <= d) || e == "") && ((q) > f) || (g == "")) flag = TRUE

    if (a >= b) && ((p >= 1000) || (p <= -1000)) && (a <= d || e == "")) && ((q) <= d || e == "")) && ((q) >= f || g == "")) flag = TRUE

    if ((g == "") && a < b) && (c >= 250)) flag = TRUE

    if (flag) T012_lbl_VorsteuerKorrekturErfolgt44.Text = "ja"; else T012_lbl_VorsteuerKorrekturErfolgt44.Text = "nein";

    I made a few mistakes with parens, but that's basically it. It looks like the same basic logic over and over again.

  • Power Troll (unregistered) in reply to Bob
    Bob:
    TRWTF is that Chrome decided to translate the page...

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

    TRWTF is Chrome. Who uses that text-based browser anymore? Try switching to Windows, moron.

  • Bogolese (unregistered) in reply to NSFW

    "Marginal Shittiness?"

  • myname (unregistered) in reply to frits
    frits:
    Hear me know and believe me later, readability is for little baby losers.
    Now I know who frits is!
  • n_a (unregistered) in reply to rnd * 1000
    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.

    No, no. You are way too fat. No more cookies for you.

  • Senior Grita (unregistered)

    Se habla aleman?

  • XXXXX (unregistered)

    I see the problem. They forgot the brackets.

        if(
        ...attrocious code here
        )
        {
            T012_lbl_VorsteuerKorrekturErfolgt44.Text = "ja";
        } else {
            T012_lbl_VorsteuerKorrekturErfolgt44.Text = "nein";
        }
    
  • Tim (unregistered) in reply to rnd * 1000
    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
  • Nick (unregistered)

    At least nobody can blame the developers for being lazy. They code and code and code and code...

  • n_a (unregistered)

    It takes me back to my own days of financial report-writing. Urgh.

    And "a bunch of changing requirements on deadline with a junior developer thrown in" sounds about right for this.

  • The Corrector (unregistered) in reply to NSFW
    NSFW:
    +1 to anyone who still actually speaks German.
    Why are they writing software in a secret language developed by dead language developed by the Nazi party that no one has spoken (or taken seriously) since WWII? My forefathers didn't fight and die to rid the world of German tyranny for nothing.
  • Web Dude (unregistered)

    So much for German engineering.

  • Nick (unregistered) in reply to rnd * 1000

    You are sooooooo wrong that it's easier to drag you out to the street and shoot you to relieve your suffering, instead of trying to explain where exactly you are mistaken about XML and databases.

    Captcha: idea - see the system agrees, that this is a good idea

  • rnd * 1000 (unregistered) in reply to Tim
    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.
  • (cs)

    And what's wrong with copying straight into WWWRoot?!

    Ok, we're not that bad [any more]... Just a quick SVN Update directly on WWWRoot instead :-)

    (Just checked, I can't browse into .svn folders on our website - Phew!!)

  • Lockwood (unregistered)

    T012_lbl_VorsteuerKorrekturErfolgt44.Text = "frist";

  • Samuel Zook (unregistered) in reply to The Corrector
    The Corrector:
    NSFW:
    +1 to anyone who still actually speaks German.
    Why are they writing software in a secret language developed by dead language developed by the Nazi party that no one has spoken (or taken seriously) since WWII? My forefathers didn't fight and die to rid the world of German tyranny for nothing.

    We Anabaptists speak it, you English dummkopf.

  • rnd * 1000 (unregistered) in reply to Nick
    Nick:
    You are sooooooo wrong that it's easier to drag you out to the street and shoot you to relieve your suffering, instead of trying to explain where exactly you are mistaken about XML and databases.

    Captcha: idea - see the system agrees, that this is a good idea

    http://en.wikipedia.org/wiki/Microsoft_Excel Come on Askimet. I'm trying to "relieve the suffering" of ignorance. Let me post a link for he who is too lazy to Google.

  • frits (unregistered) in reply to Samuel Zook
    Samuel Zook:
    The Corrector:
    NSFW:
    +1 to anyone who still actually speaks German.
    Why are they writing software in a secret language developed by dead language developed by the Nazi party that no one has spoken (or taken seriously) since WWII? My forefathers didn't fight and die to rid the world of German tyranny for nothing.

    We Anabaptists speak it, you English dummkopf.

    And I feel sorry for both of you.
  • OldCoder (unregistered) in reply to Henning Makholm
    Henning Makholm:
    Rhywden:
    Then again, if the softwar's got anything to do with the German tax code, I can see why it's _that_ complicated.
    This one is not all the tax code's fault.

    There are heaps of common subexpressions. For example, the same three date specifications are parsed upmteen times each, and comparisons between them repeated ad nausaeam. Apparently the developer has never head about using local variables to give names to meaningful intermediate results.

    Not to mention.. there's not a single return in the whole function. Readability would be greatly improved if each test just set 'ja' or 'nein' and then returned instead if wading through additional tests that are bound to turn out FALSE.

    Captcha: eros. Erm, some kind of statue thingy?

  • Larry (unregistered)

    TRWTF is internationalization

  • Nick (unregistered) in reply to rnd * 1000

    <sarcasm>Yeah right... f**k databases. Why do we need them if there's excel around.</sarcasm>

  • flt (unregistered)

    This is the exact same code, three times in a row.

    All it does is to check if some tax correction is needed. Here's some pseudo code:

    if ( T017_addChangeDate > Berichtigungszeitraum_Start
         && T017_addChangeDate <= Berichtigungszeitraum_End )
         {
         if ( T017_addChangeDate < 01.01.2005 )
              return Math.abs(T012_AenderungVorSteuer >= 250) ? "ja" : "nein" ;
         else 
              return Math.abs(T012_AenderungVorSteuer >= 1000) ? "ja" : "nein" ;
         }
    return "nein" ;
    
  • (cs)

    I love this stuff:

    table17["T017_txt_addChangeDate"]
    So, "T017_", right? Probably means it's in table17? Because even though I'm already accessing the field from the "table" I want, I need the additional precision that comes from specifying the "table" I want in the field's name.

    Forget about readability for a moment and just think about the pattern above, its inevitable recurrence throughout the codebase, and the effects it might have on maintenance. Then weep.

  • Roger (unregistered) in reply to rnd * 1000

    Oh boy we have an Excel Fanboy, someone who's written a few lengthy formulas and think they're a developer.

    captcha: illum, a word a redneck uses when trying to speak gangsta.

  • JayC (unregistered) in reply to rnd * 1000
    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.

  • (cs) in reply to NSFW
    NSFW:
    +1 to anyone who can accurately summarize the business logic in 30 words or less.

    +3 to anyone who can find the 9 bugs in that conditional.

  • JoC (unregistered)

    Jeez, you guys are such code Nazis.

  • Bob (unregistered) in reply to Lockwood
    Lockwood:
    T012_lbl_VorsteuerKorrekturErfolgt44.Text = "esrte";

    FTFY

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

Log In or post as a guest

Replying to comment #:

« Return to Article