• RFoxmich (unregistered)

    Spring forward -- Fall back fristly.

    CAPTCHA sagaciter it takes a sagaciter to understand that code.

  • D8 (unregistered)

    Job security - Obfuscate what you are doing so that you are the only person who can do it.

  • QJo (unregistered)

    This probably evolved. There may well have been a highly evolved Spring application, from which this came, along the lines:

    "Oy, Bodger, stick it in a temp database."

    "Ooh aar, temp database? How do I do that?"

    "Oh, just copy what they did on blah."

    "Ooh aar, that be compickelated ..."

    "Stop whining and just get on and do it!"

  • No (unregistered) in reply to QJo

    This has nothing to do with evolution.

  • Bob (unregistered) in reply to No
    No:
    This has nothing to do with evolution.

    Evolution means to develop over time. This isn't a biology class.

  • F (unregistered) in reply to Bob
    Bob:
    No:
    This has nothing to do with evolution.

    Evolution means to develop over time. This isn't a biology class.

    <pedant>No: evolve means to develop over time. Evolution is a noun, not a verb.</pedant>

  • (cs)

    Needs Hibernate to be more enterprisey.

  • Ten Khompson (unregistered)

    Now that's ENTERPRISE QUALITY!

  • QJo (unregistered) in reply to No
    No:
    This has nothing to do with evolution.

    You are completely certain of this exactly why? Are you not familiar with the concept of code evolving over time? It starts simply, then someone adds a bit, then someone else amends it, then someone else comes in and tidies it up a bit, and ...

    Sorry, but this looks to me like it evolved.

  • freeforall tousez (unregistered) in reply to D8
    D8:
    Job security - Obfuscate what you are doing so that you are the only person who can do it.
    and once you pass away, the next person will make their own obfuscated version of what yours suppose to do...

    the never ending cycle of reinventing the wheel lol

  • Mike Shawaluk (unregistered)

    Clearly there is a missing segment:

    <bean id="brillantPaula" ... >

  • anonymous (unregistered)

    In my opinion ORM makes generally more problems than it solves. Except if you work with flat easy data models without joined tables, but why are you using than a relational database in the first place?

    Maybe I'm out of date and they have improved by now, my last experience is from 2008.

  • (cs) in reply to anonymous
    anonymous:
    In my opinion ORM makes generally more problems than it solves. Except if you work with flat easy data models without joined tables, but why are you using than a relational database in the first place?

    Maybe I'm out of date and they have improved by now, my last experience is from 2008.

    It's not quite as bad as that, provided you've got the ability to move as much of the operation as possible into the database engine. Pulling the entire contents of a database table into memory just so you can select a row by a value that is unique… that's part of the classic ORM “pattern”.

  • (cs) in reply to anonymous

    ORM works fine if you stick to data-only classes and don't try to embed functionality (or even worse, polymorphism) into them. People use relational databases for simple problems mainly because the business mandates their use, either cause the data is already there, or they already have infrastructure in place for supporting, administering and maintaining them. Changing the world is hard, and nobody really wants to do it.

    Another perfectly valid reason on a green-fields project is to get transactional consistency with real support from an established provider (and I'm not just saying Oracle, DB2 and MS, even Postgres has been around for a while), rather than risk using some incubator project that may be dead in a year (regardless of it's sponsor).

    Yeah, ORM has it's difficulties, but if used correctly, it's just a good, strongly typed, object-oriented API for databases. IMHO: much better than the datable or recordset bullshit you get from JDBC / ODBC. Trying to actually use ORM mapped objects as something beyond data access classes will get you in trouble, but you'll only get you're fingers burned once. Then you'll learn.

    Addendum (2013-10-15 08:41): If it's easier to do with raw SQL, then DO IT WITH SQL. The idea of ORM systems is to make it easier to integrate relational databases with object oriented languages. NOT to give some astronaut architect a mandate divise convoluted object oriented ways of doing the equivalent of 3 lines of SQL with 5 classes implementing umpteen interfaces, requiring low-level hooks to your favorite ORM's mothership God-Object, which inevitably change every version.

  • (cs) in reply to No
    No:
    This has nothing to do with evolution.

    Well it certainly isn't intelligent design

  • (cs)

    Seeing that this is run as a batch job with SpringBatch I wouldn't right away give the Best Obfuscation of the Year -Award. It definitely doesn't look elegant but then again, I've yet to see elegant looking SpringBatch definitions.

  • My vote goes to... (unregistered) in reply to Roby McAndrew

    ++Roby_McAndrew

  • (cs) in reply to Ten Khompson
    Ten Khompson :
    Now that's ENTERPRISE QUALITY!
    No, I know Scotty can do much better than that.
  • Krunt (unregistered) in reply to Roby McAndrew
    Roby McAndrew:
    No:
    This has nothing to do with evolution.

    Well it certainly isn't intelligent design

    TRWTF: When someone's comment is smarter than any of the articles posted here within the last month.

    Also, Roby++

  • (cs) in reply to nonpartisan
    nonpartisan:
    Ten Khompson :
    Now that's ENTERPRISE QUALITY!
    No, I know Scotty can do much better than that.
    Ya dinna tell him how many lines it'd really take, didja? Ya never get a reputation as a miracle coder THAT way!
  • Mike D. (unregistered)
    Axiom: 95% of the cost of software is in maintenance and upgrades: if the next person can't figure out what you did without your help, you didn't do as good a job as you might think!
    That reminds me of something from about a year ago. This was for a system in Python using Django. The request was simple enough: "Code should log when objects are added, deleted, moved, or modified." All we really needed was a "LogMessage.objects.create(...)" inserted after each place where the objects in question were modified by the user, and that was generally where POST requests were handled. Pretty straightforward, didn't think much of it.

    It got done, and aside from a "deletions aren't logged" bug report, it seemed to work fine. Then, months later, about a month before that developer was going to be transferred to some other project, I was hunting down another bug and found the logging code--all of it--in the database model layer.

    Instead of doing the obvious thing outlined above, the developer had hooked into Django's "object pre-save" and "object post-save" signals and built an inference engine. The pre-save routine would take a snapshot of the object's fields and store it in a hidden field in the object, then the post-save routine would use that to find the differences in every field in the object, building up a log message, and finally saving the message to the database. (BTW, the "find differences" code wasn't any kind of fancy reflection loop; it was a bunch of if obj.field1 != obj._orig.field1: msg += "Changed field1.\n" code copied once per field. So it wasn't even general-purpose code.)

    There was about 200 lines of this stuff per object type. No comments, of course. And to top it all off, this is where the "deletions aren't logged" bug came from: the log message was generated for the now-deleted object, not its parent.

    So I had to call him in, explain that it was very clever, but it couldn't work for the deletion case, and further it was going to be hard for anyone else to figure out, let alone adapt to cover new objects, and then ask him to rip it out and replace it with "LogMessage.objects.create(...)" like it was supposed to be in the first place.

  • golddog (unregistered)

    Rule #1 of software design:

    If Rube Goldberg looks at your design and says, "Isn't that a bit too complex?", you're doing it wrong.

  • Charles F. (unregistered)

    TRWTF is not using Spring annotations to configure this. That way, these relationships are implicit and much harder to find. Putting it in declarative XML seems like giving away too many hints.

    The Obfuscators Guild will be lodging a protest.

  • Valued Service (unregistered)

    Where's the irrelevant dialog lines? Where's the insensitive witty banter? Where's the cultural stereotypes?

    Let's make a new -ism out of this. We could target people who like XML. That's Languagism!

    A whole new type of group of people could get needlessly offended and angry and use it as an excuse to display their stupidity.

    The whole website could shutdown because the .NET developers don't want to offer all their wealth of wisdom to developers in poorer community colleges using Fortran to write their thesis.

    Then we could close down the comment section and threaten people who use it with a virus that forces them to stay on the page.

    Some troll could go on a power trip and inform everyone that the site is down.

    MSDN would be left as is, allowing spammers to populate the site with junk so the young developers won't know how to learn right, and would post all their bad questions on SO.

    Then, when we have nothing but bad developers, we could blame our twitter emissions for causing net corrosion.

  • Richard Walker (unregistered)

    I'm astonished. Didn't anyone tell the author that it is illegal to publicly release code from a government website like HeathCare.gov*? The author will be in trouble now :)

    (It's not a political statement--it's a technical statement. Agree with it or not, the code is probably packed with bulls** like this, leading to its pitiful release.)

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to Ten Khompson
    Ten Khompson :
    Now that's ENTERPRISE QUALITY!
    I think its relation to the enterprise is more like this. Mr. Sulu, fire full phasers at it!
  • anonymous (unregistered) in reply to Richard Walker
    Richard Walker:
    I'm astonished. Didn't anyone tell the author that it is illegal to publicly release code from a government website like HeathCare.gov*? The author will be in trouble now :)

    (It's not a political statement--it's a technical statement. Agree with it or not, the code is probably packed with bulls** like this, leading to its pitiful release.)

    Funny that you'd bring that up... Obamacare Website Source Code: 'No Reasonable Expectation of Privacy' Unrelated text so that Akismet doesn't think this comment is spam

  • (cs)

    "devolution"

  • (cs) in reply to QJo
    QJo:
    This probably evolved. There may well have been a highly evolved Spring application, from which this came, along the lines:

    "Oy, Bodger, stick it in a temp database."

    "Ooh aar, temp database? How do I do that?"

    "Oh, just copy what they did on blah."

    "Ooh aar, that be compickelated ..."

    "Stop whining and just get on and do it!"

    Yes, definitely a case of someone who doesn't know how to do it the right way, so they do it any way.

  • (cs) in reply to Mike D.
    Mike D.:
    Axiom: 95% of the cost of software is in maintenance and upgrades: if the next person can't figure out what you did without your help, you didn't do as good a job as you might think!
    That reminds me of something from about a year ago. <<<deletia>>>

    So I had to call him in, explain that it was very clever, but it couldn't work for the deletion case, and further it was going to be hard for anyone else to figure out, let alone adapt to cover new objects, and then ask him to rip it out and replace it with "LogMessage.objects.create(...)" like it was supposed to be in the first place.

    This of course begs the BIG quiestion: Did he change the code?

  • (cs) in reply to Valued Service
    Valued Service:
    Where's the irrelevant dialog lines? Where's the insensitive witty banter? Where's the cultural stereotypes?
    Snoofle actually understands that this site is about the submitted WTFs, not about creative writing WTFs.
  • (cs)

    XML is like violence. If it doesn't solve your problem, use more.

  • Meep (unregistered)
    -- Assume table TempData exists
    Truncate table TempData;
    Insert Into TempData
    Select ... From ... Where id = 1234 and Flag Is Not NULL;

    Right, I much prefer the magical SQL that:

    1. will run itself without me setting up a JDBC connection or any of that

    2. where I can assume my table exists

    3. happily truncate a table without bothering anyone else

    4. replace my actual query logic with ...

    5. and not worry about error handling

  • Sigivald (unregistered)

    "Axiom: 95% of the cost of software is in maintenance and upgrades: if the next person can't figure out what you did without your help, you didn't do as good a job as you might think!"

    Hell, I'm likely to have to maintain that in six months.

    And I'm not going to want to waste my time trying to figure out something overcomplicated and under-documented.

    So KISS, and add comments. Comments are free.

  • anonymous (unregistered) in reply to Meep
    Meep:
    -- Assume table TempData exists
    Truncate table TempData;
    Insert Into TempData
    Select ... From ... Where id = 1234 and Flag Is Not NULL;

    Right, I much prefer the magical SQL that:

    1. will run itself without me setting up a JDBC connection or any of that

    2. where I can assume my table exists

    3. happily truncate a table without bothering anyone else

    4. replace my actual query logic with ...

    5. and not worry about error handling

    • moans "but that's too easy!"

    • why? someone else deleted it? fine, add a check to make sure it exists

    • idiots storing critical data in tables named "TempData" deserve to lose it

    • no actual logic was replaced with ...

    • moans "but that's too easy!"

  • (cs) in reply to Meep
    Meep:
    -- Assume table TempData exists
    Truncate table TempData;
    Insert Into TempData
    Select ... From ... Where id = 1234 and Flag Is Not NULL;

    Right, I much prefer the magical SQL that:

    1. will run itself without me setting up a JDBC connection or any of that

    2. where I can assume my table exists

    3. happily truncate a table without bothering anyone else

    4. replace my actual query logic with ...

    5. and not worry about error handling

    pedantic troll is pedantic

  • Vlad Patryshev (unregistered)

    This is a beautiful example of how people that are too scared to write code still do it, but use all kinds of crutches just to make sure they don't do anything wrong or hasty.

  • (cs) in reply to Sigivald
    Sigivald:
    "Axiom: 95% of the cost of software is in maintenance and upgrades: if the next person can't figure out what you did without your help, you didn't do as good a job as you might think!"

    Hell, I'm likely to have to maintain that in six months.

    And I'm not going to want to waste my time trying to figure out something overcomplicated and under-documented.

    So KISS, and add comments. Comments are free.

    The first step in fixing code that's wrong is understanding how it's wrong...

  • (cs)

    Funny how at the end he's basically doing a JDBC operation which would have only needed that "write" method.

  • Bill Bixby (unregistered) in reply to Krunt
    Krunt:
    Roby McAndrew:
    No:
    This has nothing to do with evolution.

    Well it certainly isn't intelligent design

    TRWTF: When someone's comment is smarter than any of the articles posted here within the last month.

    Also, Roby++

    Roby+=10

  • (cs) in reply to Richard Walker
    Richard Walker:
    I'm astonished. Didn't anyone tell the author that it is illegal to publicly release code from a government website like HeathCare.gov*? The author will be in trouble now :)

    (It's not a political statement--it's a technical statement. Agree with it or not, the code is probably packed with bulls** like this, leading to its pitiful release.)

    I thought that it may have been the food stamp glitch.

  • C-Derb (unregistered) in reply to Richard Walker
    Richard Walker:
    I'm astonished. Didn't anyone tell the author that it is illegal to publicly release code from a government website like HeathCare.gov*? The author will be in trouble now :)

    (It's not a political statement--it's a technical statement. Agree with it or not, the code is probably packed with bulls** like this, leading to its pitiful release.)

    I once tried to get a simple, straightforward answer about my health insurance coverage and gave up after talking to 6 different people at 4 different companies. Surely the health insurance companies have been dictating the requirements for HealthCare.gov, so I can only imagine how impossible it would be, as a developer, to get answers to basic requirements related questions from anyone in that industry.

    Despair.com ftw:

    [image]
  • (cs)

    The government shutdown has gone too far. #ALCS

  • (cs) in reply to chubertdev
    chubertdev:
    The government shutdown has gone too far. #ALCS

    Many people in the rest of the world are waiting with breathless anticipation the metaphorical sound of what would in Germany be called "Einstürzende Neubauten".

    The basic problem is: it's going to come crashing down sooner or later. The later the crash, the worse it's going to be. So sooner rather than later.

  • flukus (unregistered) in reply to dkf
    dkf:
    anonymous:
    In my opinion ORM makes generally more problems than it solves. Except if you work with flat easy data models without joined tables, but why are you using than a relational database in the first place?

    Maybe I'm out of date and they have improved by now, my last experience is from 2008.

    It's not quite as bad as that, provided you've got the ability to move as much of the operation as possible into the database engine. Pulling the entire contents of a database table into memory just so you can select a row by a value that is unique… that's part of the classic ORM “pattern”.

    That has nothing to do with an ORM, only the idiots using it. I've seen the same anti pattern followed by people using raw sql.

    It's the architecture astronauts that drive this behavior, not the ORM.

  • (cs) in reply to herby
    herby:
    Mike D.:
    Axiom: 95% of the cost of software is in maintenance and upgrades: if the next person can't figure out what you did without your help, you didn't do as good a job as you might think!
    That reminds me of something from about a year ago. <<<deletia>>>

    So I had to call him in, explain that it was very clever, but it couldn't work for the deletion case, and further it was going to be hard for anyone else to figure out, let alone adapt to cover new objects, and then ask him to rip it out and replace it with "LogMessage.objects.create(...)" like it was supposed to be in the first place.

    This of course begs the BIG quiestion: Did he change the code?

    QUIZ: What nationality are you? Do you:

    a) Say: "Very good sir," in an amusing accent, and proceed to make the required changes, albeit with spelling mistakes?

    b) Argue the case, and attempt to develop a compromise with your mentor, insisting that your way is not overdesign but a bloody good robust expandable and maintainable system, if only that fucking prick in the manager's office had allowed him the time to do the fucking job properly and not cut corners everywhere?

    c) Whine, throw a tantrum and walk out, to go and work for the company next door, scant seconds before the company you just walked out of collapses (either metaphorically or literally)?

    If you answered a) you're Indian. If you answered b) you're British. If you answered c) you're American.

  • (cs) in reply to Matt Westwood
    Matt Westwood:
    chubertdev:
    The government shutdown has gone too far. #ALCS

    Many people in the rest of the world are waiting with breathless anticipation the metaphorical sound of what would in Germany be called "Einstürzende Neubauten".

    The basic problem is: it's going to come crashing down sooner or later. The later the crash, the worse it's going to be. So sooner rather than later.

    I'm not sure what made a bigger WHOOSH sound, your post or Napoli's homer.

  • Enterprise quality (unregistered)

    TRWTF is that the author assumes that three lines of quirky SQL statements will:

    • Run in an orchestrated batch, unattended (the point is - if there's Temp Data, someone or something is using it down the road)
    • Connect themselves to the right database, unattended;
    • Process data in 5000 record chunks;
    • Properly log errors and provide operation status;
  • Norman Diamond (unregistered) in reply to anonymous
    anonymous:
    Meep:
    Right, I much prefer the magical SQL that: 3. happily truncate a table without bothering anyone else
    3. idiots storing critical data in tables named "TempData" deserve to lose it
    Actually this demonstrates why it's better to let programmers write code in their native language instead of mangling English. When I had to remangle a client's code, I first read TempData as temporary data, but then noticed it was temperature data. Later my boss read TempData as temporary data and stayed that way until I explained it to him. If the client had named it 温度データ then no one would have read it as 一時のデータ。

    Climate change deniers say they can truncate the temperature data without anyone noticing, but guess what, climate change is permanent.

  • Norman Diamond (unregistered) in reply to chubertdev
    chubertdev:
    The first step in fixing code that's wrong is understanding how it's wrong...
    Not necessarily. If you know what the code was supposed to do in the first place, you can write new wrong code from scratch instead of trying to fix old wrong code.

    In fact you can even do that if you don't know what the code was supposed to do in the first place.

Leave a comment on “Which Would YOU Rather Support?”

Log In or post as a guest

Replying to comment #:

« Return to Article