• (nodebb)

    So... the training wasn't, "Here is a test that demonstrates the requirements - oh, look, this code fails the test. There you go, make the code pass the clear tests that enunciate the requirements. When you've done that, you'll have learned how to develop in the real world"? I think that's the true WTF here.

  • Me (unregistered)

    Great anonymisation, Remi. But I think we call all figure out their real names are Bubba and Hubba.

  • Robert Morson (google)

    It's one thing to have written that. That's a bit dumb, but everyone does dumb things occasionally. It's quite another thing to see it again later on, have someone explain to you why it was dumb, and still think it is a good idea. That is stupid to the point that I do not know how these people managed to survive to adulthood.

  • Tim (unregistered)

    When you say "90% of it isn’t development at all", I think you should be explicit about the 90-10 rule:

    The 90% that takes 10% of the time is about dragging and dropping widgets onto the screen and configuring them correctly. The remaining 10% that takes 90% of the time is a hellscape of absolutely forsaken APIs, infernal coding conventions, and gibbering madness.

  • (nodebb) in reply to Robert Morson

    It's quite another thing to see it again later on, have someone explain to you why it was dumb, and still think it is a good idea.

    That "quite another thing" is approximately "I built this thing and I think it's clever and who the hell are you to think otherwise?", which is the foundation of approximately 76.438463% of the WTFs on this site. The rest are "bad bosses are bad".

    Addendum 2020-03-10 07:18: It might also be "I built this thing and I think it's clever and you're just jealous that I thought of it and you didn't."

  • (nodebb)

    The best doctors always give their patients the flu before running a test for flu. Detection rate: 100%

  • P (unregistered) in reply to Peter Street

    That doesn't stop these developers churning out TRWTF code at all, so you're TRWTF here.

  • Brian (unregistered) in reply to Peter Street

    Tests? Requirements? That's not how we do business here at Initech! We don't have time for any of that nonsense, just slap some code together and ship it. Besides, how can we rake in those lucrative support contracts if we deliver a product that actually does its job well?

  • Scott (unregistered)

    Isn't this what's called "Programming by exception?"

    At least, I've always thought of that phrase as meaning, "I found another case. Rather than understand that as part of the whole and design for it, I'll just stick in some code to try to handle that case."

    Sometimes, the problems are so complex, nobody understands the whole. So, the first cut can be this sort of info-gathering exercise. But then good developers go back and refactor once they gain understanding.

  • 🤷 (unregistered)

    This is dumb. Good thing this won't even compile, since "string" cannot be converted into "char". Unless of course, this is a weird C#-dialect (and judging from the method names IndexOf as opposed to Javas indexOf, and the mention of SharePoint, this is indeed C#).

            str = (str.Remove(str.LastIndexOf("\"")) + " \"");
            if (str.Contains(" "))
                var s = str.Remove(str.IndexOf(" ")).Trim('\"');

    would work, though (note that I used ' instead of " in the Trim).

  • (nodebb) in reply to 🤷

    It's an extension method they added to use strings for trimming.

  • Devil's Advocate? (unregistered)

    The thing that Erica is forgetting is that the Terr*s are probably the highest level of programmer that would willingly work with SharePoint.

    Oh, this code is bad, and they should feel bad, but sometimes there's a requisite amount of numbness required to keep a worker from going mad.

  • 🤷 (unregistered) in reply to Mr. TA

    I don't want to imagine what this might look like. "Oh, it kept throwing errors, so we added more code to it until they went away". The process propably involves flat files on a wooden table...

  • Rodd Tundgren (unregistered) in reply to Devil's Advocate?

    Point I was going to make. Hard to deal with Sharepoint unless you like a nice morning - and maybe post lunch - doob I'm guessing.

  • least significant bit (unregistered)

    I'll be using the term "infernal coding conventions" from now on

  • Anon (unregistered) in reply to Steve_The_Cynic

    Somebody might be envious regarding a person's coding skills, but not jealous... that's just weird.

  • MiserableOldGit (unregistered)

    Sounds like the epilogue is missing a bit, cruddy though that code is, if they were bright enough to work it out and (apparently) chuck together something that managed to work for a couple of years before falling over then it should have been possible to educate them.
    Maybe two additional years of brain damage working with SwearPoint had taken them beyond help, or perhaps Erica's boss shouldn't have experimented in asking a dev who doesn't like training people to, umm, waste time training two badly isolated and neglected "techies"?

  • purchase order (unregistered)

    "Erica raised this issue up with her boss. "

    Raise no issues with the boss. Even when things are really really messed up, just follow the same routine. "Mornin'" ... ... ... ... "See ya tomorrow."

    Boss just keeps quiet and watches.

    Make a quote, and send it to "sales". If you get in trouble, just say "I dunno. Automated, I guess. ... ... ... Did they pay?"

    Yesterday I was thinking of writing comments like #define YOUR_PAY = 0; #define YOUR_FIRED=true; and telling people to be sure to pull in the latest changes. Don't do that.

  • Rich (unregistered)

    The article seems to misunderstand the string.remove function. String.Remove in c# removes everything AFTER AND INCLUDING the index, not just 1 character at the index... so the code works. So the only WTF is that the "If" is redundant, and there should be single-quotes in the Trim call (to convert to char[]), as has been spotted by anonymous. I expect that was transcribed here wrongly and the original probably had it right, or it wouldn't compile - or as was suggested, it's an extension method which is fine. It would fail if there were quotes in the middle of the string, but maybe there never are? Doesn't seem like a big deal to me.

  • (nodebb)

    Test driven development without enough test cases.

  • Nel (unregistered)

    Why is nobody mentioning that the code in the if doesn't even do anything? It just assigns the result to a throwaway local var.

  • Tim! (unregistered) in reply to Tim

    I prefer the version of the 90-10 rule that goes: The first 90% of the project takes 90% of the time. The remaining 10% of the project also takes 90% of the time.

  • WTFguy (unregistered) in reply to Loren Pechtel

    @Loren Pechtel: This example demonstrates the essential futility of TDD in many situations. Human dates have essentially no true rules;They're simply a steaming pile of exceptions.

    Proper TDD for this function would require test instances feeding in the first, last, and some middle date(s) of each month of both leap and non-leap years. And once you'd coded up those 3122 test cases, it would have been cheaper to simply have written the function as a lookup into a hard-coded list of hand-generated and hand-validated answers.

    TDD is awesome when your problem isn't full of edge cases. But when the problem is nothing but edge cases ...

    At least with dates the edge cases are knowable (for someone diligent enough to enumerate them all correctly). We've all enjoyed building systems from weak requirements or against poorly documented or buggy APIs where the edge cases are not only unknown, they're unknowable. Or at least unknowable until each edge case reveals itself as a production bug.

  • WTFguy (unregistered)

    Wow. Markdown took my input of "3 times 12 times 2" with "*" where I just wrote "times" and somehow converted that to "3122".

    I have no idea why or how. An eternal headscratcher markdown is.

  • WTFguy (unregistered)

    Annnnnd...I now see I posted this comment in the wrong thread. I'll just back out quietly now. Sorry to intrude.

  • Richard Wells (unregistered) in reply to Scott

    "Programming by exception". Or, as I prefer to call it, bang-on-it-until-it-works programming.

    I teach CS. One semester, one of the assignments in my algorithms class was to write upper_bound(); it's a binary search variant that returns the index of the first element greater than or equal to the value you're searching for. It's actually simpler than the usual book version of a binary search (and often more useful) - it has only one comparison in the loop rather than two.

    Anyway, one student handed in a solution that must have been 500 lines. Apparently, every time it failed one of my test cases, he added code to handle the specific case. That's when I learned to have hidden test cases that students can't see. It's also when I learned to be skeptical of TDD.

  • syntax_erorr (unregistered)

    I believe that should be Terr{i,y}

  • (nodebb) in reply to WTFguy

    * is the MarkDown italics indicator, so 3*12*2 is MarkDown for 3122 but with the inner 12 in italics. (This is why I always wrap code in backticks, which is MarkDown for... code! As long as you don't want backticks in your code of course...)

  • Jim T (unregistered)

    should definitely be "Terr[iy]s"

Leave a comment on “Request for Quote”

Log In or post as a guest

Replying to comment #:

« Return to Article