• Michael R (unregistered)

    This made me smile. I also saw this kind of SQL craftsmanship back in the early 2000s.

  • DeeKay (unregistered)

    Hacking the Delphi linker to handle .... yeah ... NO.

  • Sauron (unregistered)

    "insert this substring at position 57."

    That sounds like a recipe for SQL injection.

  • (nodebb)

    I was trying to reference an existing comment and mangle its text by substituting certain characters, but couldn't because they were all held for moderation.

  • NotAlone (unregistered)

    I got a similar one when adding translations to our software.

    Someone had the great idea to link all the buttons (about 50 of them) to one function that parses the clicked button text to determine the action to do.

    Guess what happen when you change the text on the buttons to have them in an other language...

  • PAH (unregistered)

    TRWTF is to assume that a public method, the Getter function, is only used for debugging, and not follow up to see where it's called. Especially in legacy code, that's a recipe for disaster.

  • (nodebb) in reply to PAH

    Assuming that a getter is only used for debugging is a recipe for trouble, but the article's sort of mangling is not the kind of trouble that you'd normally expect.

  • (nodebb)

    This reminds me of a JSON storage engine I wrote for an embedded platform. To save space, if you tried to store a string value, it would search the ROM to see if there was a sequence of bytes that matched the string, and used that instead.

    It made sense seeing as the JSON was often storing an option by name represented as a string, and so the string to compare the name of the option had to be somewhere in the ROM anyway.

  • (nodebb) in reply to DeeKay

    "Hacking the Delphi linker to handle .... yeah ... NO."

    In all my years of using Delphi, both professionally and for my own personal projects, I have never had to do this. I would say that this is a huge red flag for a mountain of bad code. The article seems to confirm this.

  • Brian Boorman (unregistered)

    So... they gave her bottle of wine to reward her for horrible behavior. Bad code aside, if you have any kind of mature process you don't just go about changing things unrelated to your task, and do so without a care for understanding how the code works and not even testing your change before committing.

  • (author) in reply to Brian Boorman

    I mean, with a CI process and presumably the fact that she's working on an isolated branch, the "failure to test before committing" is a very mild grievance. And more to the point, it's a common thing to carefully cleanup formatting in older code- I'm a big fan of "leave the code better than you found it". If you have a cheap and easy opportunity to pay down some technical debt, pay it!

  • Anon (unregistered)

    Does Anyone remember an article from years ago, about a PHD hire who wrote a proof that his code would work, but when his code, failed, he said it was the softwares fault?

    Or, does anyone have a good way of being able to search random articles from years ago?

  • Duke of New York (unregistered)

    Bad code is never "aside"

  • Duke of New York (unregistered) in reply to Anon

    Yes, I have a way to search for that:

    https://thedailywtf.com/articles/classic-wtf-the-proven-fix

  • (nodebb) in reply to Anon

    Does Anyone remember an article from years ago, about a PHD hire who wrote a proof that his code would work, but when his code, failed, he said it was the softwares fault?

    https://thedailywtf.com/articles/The-Proven-Fix

    Or, does anyone have a good way of being able to search random articles from years ago?

    I used a newfangled thing whose name looks like a mispronunciation of "googol".

  • (nodebb) in reply to NotAlone

    The software we use could have this problem. Could. It allows not only to parse the keyboard button's text, but access the keycode directly as well. I learned about text parsing after using the keycodes for years, and then been scratching my head for months trying to understand why anyone would use something so unreliable (for starters, everyone constanly forgets to switch their keyboard locale).

  • vuvug (unregistered)

    thank you for sharing the information though this blog

  • (nodebb) in reply to Allexxann

    everyone constanly forgets to switch their keyboard locale

    The fact you mention switching locales implies you seem to work in a multilingual environment, which puts you way ahead of the curve to handle i18n.

    More than once I had the unfortune to have to explain to coworkers why writing 'append "s" if n > 1' is a terrible way to handle pluralization, for example.

  • kiravuo (unregistered)

    Years ago I broke some APL by adding a comment. Comments should not break code, but I added it after a label and then found a goto '→ Label + 2'. APL is very line oriented, comments count as lines.

    That was when I learned that just because you can do something does not mean that you should do it. Somebody thought to save a label.

  • (nodebb) in reply to Ralf

    I wouldn't call it multilingual - we all use Russian, but for scientific and programming stuff we have to rely on English.

    "Append 's'" - yikes.

  • haroon (unregistered)

    The software we use could have this problem. Could. It allows not only to parse the keyboard button's text, but access the keycode directly as well. I learned about text parsing after using the keycodes for years, and then been scratching my head for months trying to understand why anyone would use something so unreliable (for starters, everyone constanly forgets to switch their keyboard locale) Seo

  • haroon (unregistered)

    The software we use could have this problem. Could. It allows not only to parse the keyboard button's text, but access the keycode directly as well. I learned about text parsing after using the keycodes for years, and then been scratching my head for months trying to understand why anyone would use something so unreliable (for starters, everyone constanly forgets to switch their keyboard locale) Seo

  • pudin9 (unregistered) in reply to Brian Boorman

    "Bad code aside, if you have any kind of mature process you don't just go about changing things unrelated to your task"

    Based on the article, it was kinda bad code. Also, there's the Boy Scout Rule.

  • wtf? (unregistered)

    This is one of those obvious bot spam comments, where they just say some generic thing that you could say about a lot of blogs (so there's no evidence they actually read the blog), and then post a link... how did this pass moderation?! (and before you say the captcha on the comment form means it can't be a bot, consider that there are APIs that bots can use to hire people to solve captchas)

Leave a comment on “Modular Dependencies”

Log In or post as a guest

Replying to comment #:

« Return to Article