• Dilbert (unregistered)

    MUMPS, now called Cache is NOT a limited and perverted language

  • Anonymous (unregistered)

    0110011001101001011100100111001101110100

  • Joel (unregistered)

    0001101100101001010100st

  • Knux2 (unregistered)

    Oh, ouch. Ouch ouch ouch.

  • PB (unregistered)

    Now that's Proper coding. Not too many worries about their code being reverse engineering, I imagine.

  • Mike (unregistered)

    I stopped reading halfway down. If I had a job that involved this code, my next words would be "I quit".

  • Alargule (unregistered)

    WTF does it do???

    (apart from being featured in TDWTF)

  • Eric (unregistered)

    This code is dubbed Job Security. It has the look of needing to be modified often(from the comments, I didn't actually try and understand it).

  • MrPotes (unregistered)

    Blimey, that's crazy - I mean, who'd go to the trouble of putting "[1]{1}" in a regex, instead of just "1"?!

  • ceiswyn (unregistered) in reply to Dilbert
    Dilbert:
    MUMPS, now called Cache is NOT a limited and perverted language

    It is, however, named after a disease. Gotta wonder about that, really.

  • anonymous hater (unregistered)

    10% of the way through reading this code I realized I was polluting my brain w/junk. So in order to protect my logic circuits I punch myself in the head.

    Once I awoke I realized I should warn others.

    DO NOT READ THIS CODE IT WILL CAUSE A SEGMENTATION_FAULT in YOUR BRAIN.

    CAPTCHA: eros - errors indeed

  • (cs)

    Thank goodness that management never changes requirements, 'cuz otherwise that piece of (ummm...) code would cause some major headaches to modify.

    So! Any guesses as to what this is (errr ahhh...) 'designed' to accomplish?

    • DON'T LOOK AT THE CODE, MARION!
    • It's beeeyooootiful!
    • cue swirling gasses and spirits that make your skull melt
  • (cs)

    The sample strings are 82 bits long. I did a cursory search on google and I can't see any popular DB (MSSQL, MySQL or Orace) that supports 96 bit integers. So storing the result in a varchar column isn't totally in the realms of stupidity. The alternatives would have been to split the value up into multiple columns, which then creates the issue of trying to ensure that the columns are assembled in the correct order when you are doing a query.

    Of course I bet that there may have been another way to encode the information so you didn't have to jump through all of these hoops.

  • Macke (unregistered)

    Aaahhhhhhhahaahhhhhrrrgghhh!!!

  • mike5 (unregistered)

    My God, it's full of 0's and 1's!

  • Anon (unregistered)

    I think some day I heard that TRWTF was PHP...

  • Leo (unregistered) in reply to Macke
    Macke:
    Aaahhhhhhhahaahhhhhrrrgghhh!!!

    My thoughts exactly.

  • bl@h (unregistered)

    $smarty->ass

    captcha: iusto --> No I didn't

  • (cs)

    I had the pleasure of inheriting some C# code that expanded hex characters into binary strings using the infamous loop over a switch anti-pattern. The method would expect an 64 bit ascii hex string (8 characters) and the code would create an intermediate string of 64 ones and zeros. Then certain status bits were parsed from the result using string manipulation methods.

    I replaced about 150 lines of nonesense with something like:

        UInt64 result = Convert.ToUInt64(myString, 16);
    
    
    

    BTW- There's at least one language (ATLAS) that supports binary strings natively. But it's so old and obscure it barely warrants mentioning.

  • highphilosopher (unregistered) in reply to Anon
    Anon:
    I think some day I heard that TRWTF was PHP...

    You can write some pretty elegant code in PHP. The real problem is that it has such a low learning curve that almost any idiot with a keyboard can write code in PHP.

    Captcha: iusto -- Kinda like gusto, but more selfish.

  • Justin (unregistered) in reply to highphilosopher
    highphilosopher:
    Anon:
    I think some day I heard that TRWTF was PHP...

    You can write some pretty elegant code in PHP. The real problem is that it has such a low learning curve that almost any idiot with a keyboard can write code in PHP.

    Captcha: iusto -- Kinda like gusto, but more selfish.

    Like VBA!

    Ninja Vanish!

  • Justin (unregistered)

    an Epic WTF.

    CAPTCHA: augue....yeah its british for argue.

  • Keith Twombley (unregistered)

    My favorite part is the very end. They're using Smarty! So great. All that idiotic crap, and then at the end they still had the presence of mind to use a templating engine.

  • justsomedude (unregistered)

    perchance? perchance? dear god why....

    I never made it to the punchline, once the code started I made it all of 3 seconds before giving up.

  • AnOldRelic (unregistered)

    TRWTF is.... TRWTF is... aww, to heck with it. Today's WTF is TRWTF.

  • djh (unregistered)

    I'm not even going to attempt to waste valuable brain cycles on trying to interpret what the hell that code does.

    Maybe the developer was told to obfuscate his code, but he didn't get the memo.

  • Neville Flynn (unregistered)

    It's Great Codethulhu!

  • David Hamilton (unregistered)

    A great example of the old maxim:

    Just because you can do it that way doesn't mean that you should.

  • Dank (unregistered)

    Holy F*&%, that's some convoluted code!. I wonder what kind of data those binary strings are storing? If it's actually another data type, it might be possible to write a function that parses it and converts it into something sane, then worry about interpreting it.

  • student (unregistered)

    The only thing I could think of while reading this was that I had already solved this problem. Store the damn value as an integer and just do a quick conversion. (I use it to determine admin privileges).

  • wtf (unregistered)

    MY god... it's full of dumb!

  • TV's frank (unregistered)

    It's the first time code makes me cry.

  • (cs) in reply to OzPeter
    OzPeter:
    The sample strings are 82 bits long. I did a cursory search on google and I can't see any popular DB (MSSQL, MySQL or Orace) that supports 96 bit integers. So storing the result in a varchar column isn't totally in the realms of stupidity. The alternatives would have been to split the value up into multiple columns, which then creates the issue of trying to ensure that the columns are assembled in the correct order when you are doing a query.

    Of course I bet that there may have been another way to encode the information so you didn't have to jump through all of these hoops.

    May have been? How about a fixed-point decimal column? Or even two integer columns (one 64-bit and one 32-bit)?

    Also, there's no such product as "MSSQL". Or "Orace" for that matter.

  • CodeNinja (unregistered)

    ARRGHH!

    The goggles, they do nothing!

  • Someone who can't be bothered to login from work (unregistered) in reply to OzPeter
    OzPeter:
    The sample strings are 82 bits long. I did a cursory search on google and I can't see any popular DB (MSSQL, MySQL or Orace) that supports 96 bit integers. So storing the result in a varchar column isn't totally in the realms of stupidity. The alternatives would have been to split the value up into multiple columns, which then creates the issue of trying to ensure that the columns are assembled in the correct order when you are doing a query.

    Of course I bet that there may have been another way to encode the information so you didn't have to jump through all of these hoops.

    As it happens, 82-bits is also the size of the floating point registers in the IA-64 architecture.

  • (cs)

    Awesome. Like some of the classic TDWTFs of yore.

  • (cs) in reply to MrPotes
    MrPotes:
    Blimey, that's crazy - I mean, who'd go to the trouble of putting "[1]{1}" in a regex, instead of just "1"?!
    Consistency.
  • Matt S (unregistered) in reply to TV's frank

    I came to say the same thing. It started off bad, then got worse, then worse, than tear-worthy.

  • jjs (unregistered)

    Can't wait for the narrated version!

  • KittyKat (unregistered)

    It was horrible ones and zeros everywhere and I think I saw a two

  • anonymous coward (unregistered)

    I would laugh... if it wasn't so much like the code I have to maintain (and yes, I clean it up where I can)

    When I leave this job I have so many WTFs to show you.

  • (cs)

    This was an interesting interpretation of 'snippet' I had not previously encountered.

  • bp (unregistered)

    I feel so bad for the Hear-A-Blog guy who will have to read that code.

  • (cs)

    <comment redcated>

  • jjs (unregistered) in reply to Zylon
    Zylon:
    <comment redcated>
    <reply redacted>
  • Tom Woolf (unregistered)

    There once was an outside consulting firm that would modify my company's code for clients. They were known to add hundreds (if not thousands) of lines of useless code with the intent of obscuring the real code in the useless spaghetti code.

    Compared to whomever wrote the code featured in today's TDWTF, those consultants were rookies. Today's code hides its purpose and process brilliantly. As another poster stated - this is job security...

    Or, as Scott Adams put it: http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/20000/3000/700/23765/23765.strip.gif

  • (cs) in reply to Dilbert
    Dilbert:
    MUMPS, now called Cache is NOT a limited and perverted language

    Correct, it is a limitlessly perverted language.

    Addendum (2010-06-14 11:14): Or a lanuage with unlimited perversions.

  • FragFrog (unregistered) in reply to OzPeter
    OzPeter:
    The sample strings are 82 bits long. I did a cursory search on google and I can't see any popular DB (MSSQL, MySQL or Orace) that supports 96 bit integers.
    I know for a fact MySQL supports binary data columns and it would greatly surprise me if all other database environments did not have similar data types. One would normally use them for storying binary data (like images if you are an idiot) but they would do well enough for bitmasks. Provided you need more than 31 masks of course, which in and of itself is already quite a WTF.
  • (cs)

    I'm pretty sure this is the Necronomicon code. Don't read it out loud!!

    There are 10 types of people in this world..

  • TK (unregistered) in reply to Aaron
    Aaron:
    Also, there's no such product as "MSSQL".
    Right. Just like there's no such product as a "Ford Mustang."

Leave a comment on “1's and 0's”

Log In or post as a guest

Replying to comment #:

« Return to Article