• fjf (unregistered) in reply to Bobble
    Bobble:
    BA: The users want the system to identify addresses that may be dates.

    DEV: Wha!?!?!?

    BA: The users want the system to identify addresses that may be dates.

    DEV: That sounds pretty dumb, what problem are they trying to solve?

    BA: That the system doesn't identify addresses that may be dates.

    DEV: Uh...but...

    This is just an example of what happens when you are given solutions instead of requirements.

    DEV: So what if someone actually lives in October Road?

    BA: Uh ... well ... hang on ...

    I've found over the years that it sometimes helps against stupid requirements to give silly counter-examples (which is why I've become quite good at making up such examples on the spot).

  • fjf (unregistered) in reply to kjordan
    kjordan:
    Except it doesn't negate the check, so it'll never happen.

    Maybe this was the poor programmer's way of subverting the stupid requirement with plausible deniability ...

  • Keith Brawner (unregistered)

    I actually went through reading this, and said "I'm going to understand this one before I read the evalutation".

    Then I got to: processingClient.StreetAddress.Line1 != null and I said "okay, an irrelevant if statement, that's fine, a mistake, but nothing to quibble over

    Then I got to: processingClient.StreetAddress.Line1.Contains(month) If your street address contains a month... but only a 3 letter abreiviation (first letter cap)... throw an error?

    Not only does this code have no point, but it uses a bad practice, and doesn't even test what it was trying to. For example, "OCTOBER ROAD" gets through while "October Road" doesn't, and "--Martin Luther King Blvd" makes it while "Martin Luther King Blvd" doesn't.

    True Worse Than Failure! Best one in a while, Alex, kudos!

  • fjf (unregistered)
    Alex Papadimoulis:
    Aaron adds, Aaron adds, “I’m not exactly sure what thought process lead to this ...”

    I wonder why I wonder why nobody has commented on the double "Aaron adds" so far ...

  • Anonymous (unregistered) in reply to Anonymous
    kjordan:
    Except it doesn't negate the check, so it'll never happen.
    Yes I noticed that, hence my follow up post:
    Anonymous:
    Oh, but it isn't !IsNullOrEmpty at all! OK, so I'm guessing this was a transcribing error. I'm sure that first call to IsNullOrEmpty is supposed to be !IsNullOrEmpty.
  • Ivan Ivanovitch (unregistered)

    // maybe I needing later string[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

    if (processingClient.StreetAddress != null && string.IsNullOrEmpty(processingClient.StreetAddress.Line1)) { for (String month : months) { if (processingClient.StreetAddress.Line1 != null && processingClient.StreetAddress.Line1.Contains(month)) { writeError(processingClient, errorList, "Street address line 1 is in date format (" + processingClient.StreetAddress.Line1 + ")."); } if (processingClient.StreetAddress.Line2 != null && processingClient.StreetAddress.Line2.Contains(month)) { writeError(processingClient, errorList, "Street address line 2 is in date format (" + processingClient.StreetAddress.Line2 + ")."); } if (processingClient.StreetAddress.Line3 != null && processingClient.StreetAddress.Line3.Contains(month)) { writeError(processingClient, errorList, "Street address line 3 is in date format (" + processingClient.StreetAddress.Line3 + ")."); } } }

  • (cs)

    It's a good thing they don't have any customers living in March.

  • (cs)

    I'm so happy that I live on 05/12/2007 Avenue.

  • Anon (unregistered) in reply to Keith Brawner
    Keith Brawner:
    Martin Luther King Blvd

    Good example, just about every major US city has an MLK.

  • Anon (unregistered) in reply to Anon
    Anon:
    Keith Brawner:
    Martin Luther King Blvd

    Good example, just about every major US city has an MLK.

    Go to love Wikipedia:

    http://en.wikipedia.org/wiki/List_of_streets_named_after_Martin_Luther_King,_Jr.

    (At the same time, go to hate Akismet for being so retarded)

  • Bim Job (unregistered) in reply to John
    John:
    PITA:
    I'd like to be under the sea In an octopus' garden in the shade He'd let us in, knows where we've been In his octopus' garden in the shade

    If you listen carefully, you'll notice the Beatles got their apostrophes right.

    I'd like to be under the sea In an octopus's garden in the shade He'd let us in, knows where we've been In his octopus's garden in the shade

    Just the one octopus, so it takes "'s"

    Well, that was because the boys didn't want to confuse Ringo with the plural. Personally, I still feel that "Octopodes' Garden" scans better, and it certainly lacks that irritating Scouse nasal whine.

    The software under discussion would also error out on Lennon's touching lament for his mother ("Julia"), so let's hope it's confined to street addresses and not Spotify streams.

    (Incidentally, if you really had to do this, what's wrong with checking for (a) the full name of the month (b) a suffixed whitespace or (c) a suffixed period? It's still utterly useless, but at least it is canonical and unimpeachable uselessness.)

  • fjf (unregistered) in reply to dkf
    dkf:
    It's a good thing they don't have any customers living in March.
    If all of their code is like this, they may not even have any customers living in March.
  • (cs) in reply to Keith Brawner

    [quote user="Keith Brawner"]Not only does this code have no point, but it uses a bad practice, and doesn't even test what it was trying to. For example, "OCTOBER ROAD" gets through while "October Road" doesn't, and "--Martin Luther King Blvd" makes it while "Martin Luther King Blvd" doesn't.[/quote]

    "--Martin Luther King Blvd".Contains("Mar") == true "--Martin Luther King Blvd".StartsWith("Mar") == false

    Users["Kieth Brawner"].Education <= EducationLevels.SomeCollege

    hmmm...

    [quote user="Keith Brawner"True Worse Than Failure! Best one in a while, Alex, kudos![/quote]

    I agree, Alex's ability to find real WTFs for articles without making himself TRWTF is daily getting worse...

  • Outtascope (unregistered) in reply to Nibh
    Nibh:
    More validation is always better. We can't have our data jumpin' around all nimbly-bimbly from tree to tree...
    Meow is not a good time for facetiousness.
  • Bim Job (unregistered) in reply to md5sum

    [quote user="md5sum"][quote user="Keith Brawner"]Not only does this code have no point, but it uses a bad practice, and doesn't even test what it was trying to. For example, "OCTOBER ROAD" gets through while "October Road" doesn't, and "--Martin Luther King Blvd" makes it while "Martin Luther King Blvd" doesn't.[/quote]

    "--Martin Luther King Blvd".Contains("Mar") == true "--Martin Luther King Blvd".StartsWith("Mar") == false

    Users["Kieth Brawner"].Education <= EducationLevels.SomeCollege

    hmmm...

    [quote user="Keith Brawner"True Worse Than Failure! Best one in a while, Alex, kudos![/quote]

    I agree, Alex's ability to find real WTFs for articles without making himself TRWTF is daily getting worse...[/quote]

    Oh great. Not only is Bowytz incapable of proof-reading his own submissions; now it's spreading to respected contributors.

    (As a non-respected contributor, I got mine wrong too.)

  • Fred (unregistered) in reply to fjf
    fjf:
    kjordan:
    Except it doesn't negate the check, so it'll never happen.

    Maybe this was the poor programmer's way of subverting the stupid requirement with plausible deniability ...

    +1 Credible. Look, this whole thing reeks of ignorant manager/obedient programmer. Some user entered a date, some bigshot freaked out, and the order came down to make sure that never happens again. As usual, the request didn't describe the problem and ask the developer to find a solution, instead, someone who knew almost nothing about technology dictated the technicalities of the fix.

    At this point the best thing the developer can do is obey. That is, until you get a chance to replace your ignorant manager.

  • (cs) in reply to Fred
    Fred:
    fjf:
    kjordan:
    Except it doesn't negate the check, so it'll never happen.

    Maybe this was the poor programmer's way of subverting the stupid requirement with plausible deniability ...

    +1 Credible. Look, this whole thing reeks of ignorant manager/obedient programmer. Some user entered a date, some bigshot freaked out, and the order came down to make sure that never happens again. As usual, the request didn't describe the problem and ask the developer to find a solution, instead, someone who knew almost nothing about technology dictated the technicalities of the fix.

    At this point the best thing the developer can do is obey. That is, until you get a chance to replace your ignorant manager.

    The obedient programmer should've come up with a more elegant solution. Like I posted earlier, DateTime.TryParse() (if this is .net) or some equivalent could easily inverse-validate for unwanted dates.

  • fjf (unregistered) in reply to md5sum
    md5sum:
    Keith Brawner:
    Not only does this code have no point, but it uses a bad practice, and doesn't even test what it was trying to. For example, "OCTOBER ROAD" gets through while "October Road" doesn't, and "--Martin Luther King Blvd" makes it while "Martin Luther King Blvd" doesn't.

    "--Martin Luther King Blvd".Contains("Mar") == true "--Martin Luther King Blvd".StartsWith("Mar") == false

    Users["Kieth Brawner"].Education <= EducationLevels.SomeCollege

    hmmm...

    [quote user="Keith Brawner"True Worse Than Failure! Best one in a while, Alex, kudos![ /quote]

    I agree, Alex's ability to find real WTFs for articles without making himself TRWTF is daily getting worse...

    Complaining about someone's education while misquoting and mistyping his name. Classic Muphry's ...

  • (cs) in reply to Bim Job
    Bim Job:
    Oh great. Not only is Bowytz incapable of proof-reading his own submissions; now it's spreading to respected contributors.

    (As a non-respected contributor, I got mine wrong too.)

    Oops... I missed a brace... didn't I?

    Addendum (2010-03-03 12:04):

    fjf:
    Complaining about someone's education while misquoting and mistyping his name. Classic Muphry's ...
    I know... I'm such a n00b... :-/
  • AlanGriffiths (unregistered)

    Or "Market Square"?

  • (cs)

    This sort of thing is quite common on embedded devices with no filesystem in which to host proper date validation.

  • (cs)

    Or 28. října in Prague (and several other towns/villages in Czech Republic). It translates to '28 October', or 'October 28' for Americans. There's a few other simlar street names, just can't think of them now.

  • Anonymous (unregistered) in reply to Mason Wheeler
    if (processingClient.Comment.Line1 != null
        && processingClient.Comment.Line1.Contains("embedded devices with no filesystem"))
      {
        writeError(processingClient,
          errorList,
          "Comment line 1 is in moron format ("
            + processingClient.Comment.Line1 + ").");
      }
    
  • (cs) in reply to Mel

    Yeah, I used to live in Argentina, and I saw plenty of that. Just about every town, no matter how small, has a 9 de Julio street, (their Independence Day,) and a handful of other important dates.

  • Pragmatopian (unregistered) in reply to Mel
    <Useless Trivia>

    Other Prague street names doubling up as dates include:

    5 Kvetna (5 May)

    and

    17 Listopadu (17 November.

    Various streets are named after public holidays.

    </Useless Trivia>

  • Jay (unregistered)

    Hey, you think this is bad. You should see their date validation function. It begins:

    if (birthdate.contains("New York")
      || birthdate.contains("Los Angeles")
      || birthdate.contains("Chicago")
      || birthdate.contains("Houstaon")
      || birthdate.contains("Phonenix")
      || birthdate.contains("Philadelphia")
      || birthdate.contains("San Diego")
      || birthdate.contains("Dallas")
    ... etc ...
    
  • quisling (unregistered)
    Alex Papadimoulis:
    ...instead, they&rsqou;re painted orange .
    Alex Papadimoulis:
    leaving our end users to adding random hyphens and spaces
    You see, Mark, you see Mark? This is how you This is how you proper irony.

    Short and sweet.

    Oh, and lmfao:

    Bim Job:
    Oh great. Not only is Bowytz incapable of proof-reading his own submissions; now it's spreading to respected contributors.

  • (cs)

    Aaron adds, Aaron adds, “I’m not exactly sure what thought process lead to this, but the powers that be aren’t too keen about changing it, leaving our end users to adding random hyphens and spaces for those unfortunate enough to live on ‘October Road’.”

    Aaron wants to be very sure that we know that it's HIM adding this.

    Also, I hope I never have to order anything from these guys, they'll be so messed up when they are told to turn onto JUNor avenue, and then once they figure it out they'll bring broadswords and shields when they're told to "go to WARd road", and then they'll probably get some kind of logic error when they finally turn onto "geORge road".

  • Why? (unregistered) in reply to Matt Westwood
    Matt Westwood:
    I can guess what happened here. The database was initially seeded from a whole bunch of externally-supplied files, some of which were in a format different from what was expected, having dates where addresses were expected. We've done similar things in the past.

    In order for the app to detect that such a file was of that format, this snippet was written (by an intern, as this is the sort of thing you give rookies to program). Unfortunately, due to some configuration management mistake, it made it to production. And the guy who was initially behind this code snippet (the bloke who initially told the intern / student what to do) is no longer around.

    Database integrity belongs somewhere in the database. If an address field has a date, then some date field (i.e. type DATE) must have a non-date. The database server should fail to load the incorrect fields based on type-mismatch.

    There is no good reason to write detection code to sanitize a database. SQL handles this for you via type-safety, constraints, & CAST functions.

  • (cs) in reply to md5sum
    md5sum:
    Admittedly the code is a WTF, but so are the statements made about it...
    Oh please, they&rsqou;res nothing wrong with the writing in today's WTF.
  • Max (unregistered) in reply to Jay
    Jay:
    Hey, you think this is bad. You should see their date validation function. It begins:
    if (birthdate.contains("New York")
      || birthdate.contains("Los Angeles")
      || birthdate.contains("Chicago")
      || birthdate.contains("Houstaon")
      || birthdate.contains("Phonenix")
      || birthdate.contains("Philadelphia")
      || birthdate.contains("San Diego")
      || birthdate.contains("Dallas")
    ... etc ...
    

    Or the function that validates that the address is not a CC number:

    if (address.contains("0000-0000-0000-0000-0001")
      || address.contains("0000-0000-0000-0000-0002")
      || address.contains("0000-0000-0000-0000-0003")
      || address.contains("0000-0000-0000-0000-0004")
    ...
      || address.contains("9999-9999-9999-9999-9997")
      || address.contains("9999-9999-9999-9999-9998")
      || address.contains("9999-9999-9999-9999-9999"))
    {
       writeError(processingClient,
          errorList,
          "Street address line 1 is in credit card number format (" + address + ").");
    }
    
  • (cs)
    Zylon:
    md5sum:
    Admittedly the code is a WTF, but so are the statements made about it...
    Oh please, they&rsqou;res nothing wrong with the writing in today's WTF.

    You mean that you mean... "Oh please, there&rsqou;s nothing wrong with the writing in today&rsqou;s WTF."

  • (cs) in reply to fjf
    fjf:
    Alex Papadimoulis:
    Aaron adds, Aaron adds, “I’m not exactly sure what thought process lead to this ...”

    I wonder why I wonder why nobody has commented on the double "Aaron adds" so far ...

    If we keep highlighting Alex's mistakes as WTFs, it's only encouraging him to sprinkle more of them in all of his posts. When the WTF in the article is not good enough, Alex's writing SNAFUs provide enough amusement.

    I should add that I'm not exactly sure what thought process lead to this. It's just what I think causes Alex's writing WTFs.

  • Anon (unregistered) in reply to Why?
    Why?:
    Matt Westwood:
    I can guess what happened here. The database was initially seeded from a whole bunch of externally-supplied files, some of which were in a format different from what was expected, having dates where addresses were expected. We've done similar things in the past.

    In order for the app to detect that such a file was of that format, this snippet was written (by an intern, as this is the sort of thing you give rookies to program). Unfortunately, due to some configuration management mistake, it made it to production. And the guy who was initially behind this code snippet (the bloke who initially told the intern / student what to do) is no longer around.

    Database integrity belongs somewhere in the database. If an address field has a date, then some date field (i.e. type DATE) must have a non-date. The database server should fail to load the incorrect fields based on type-mismatch.

    There is no good reason to write detection code to sanitize a database. SQL handles this for you via type-safety, constraints, & CAST functions.

    Well that works if and only if we assume that a date appearing in a non-date (string) field means that a real date field contains a non-date. It wouldn't catch a case where say an extra date appears in a usually non-date field

  • Fred (unregistered) in reply to frits
    frits:
    Fred:
    ...As usual, the request didn't describe the problem and ask the developer to find a solution, instead, someone who knew almost nothing about technology dictated the technicalities of the fix.

    At this point the best thing the developer can do is obey. That is, until you get a chance to replace your ignorant manager.

    The obedient programmer should've come up with a more elegant solution. Like I posted earlier, DateTime.TryParse() (if this is .net) or some equivalent could easily inverse-validate for unwanted dates.
    But that's my point. The boss probably didn't say "check for unwanted dates in the address" instead he probably said "Someone submitted Dec 25, 2009 in the address field, so from now on I want you to check every address line for any month names and reject them."

    Specifying the solution, not the problem. Happens all the time, and that is (drum roll) TRWTF.

    (Next time you hear a non-technical person say "I want to redirect the user to..." you'll remember and understand.)

  • Bim Job (unregistered) in reply to quisling
    quisling:
    Oh, and lmfao:
    Bim Job:
    Oh great. Not only is Bowytz incapable of proof-reading his own submissions; now it's spreading to respected contributors.
    Traditionally on this site, it's Mark. In this case, it's Alex. He's catching up!

    Fucking arrogant as I am, I also pointed out that I buggered up my own contribution. In the spirit of true humility, I will now come clean: I buggered it up twice. The first one I can blame on this crummy keyboard. The other one -- well, I have no defence for that.

    Frankly, if I was part of a small team delivering tech humour to the Web on a punishing schedule, I'd bugger up far more often than either of them.

  • (cs) in reply to Anonymous
    Anonymous:
    I wondered why I couldn't order anything off you guys.

    Regards

    Jane Doe 42 Juliet Place Marchwood

    You don't even need to do that. There's a town called March that I once used to work in.

    EDIT: zomg! Someone else already mentioned the shithole!

  • (cs) in reply to fjf
    fjf:
    dkf:
    It's a good thing they don't have any customers living in March.
    If all of their code is like this, they may not even have any customers living in March.
    I promise you, life in March really does not count as "living". Trust me, I've been there.
  • anon (unregistered) in reply to Quirkafleeg
    Quirkafleeg:
    Sad Bug Killer:
    Btw, what language is that? String, string and IsNullOrEmpty suggest C#, but the `for (String month : months)` is not C#-y. Anonymization gone wrong?
    C++ (well, C++0x, or C++1x as it should be known now) has that construct.

    It's still C++0x, just now it's C++0xB

  • blar blar (unregistered) in reply to Seminymous Coward
    Seminymous Coward:
    My favorite part is the nonsensical "&& string.IsNullOrEmpty(processingClient.StreetAddress.Line1)" in the outer if.

    The only thing I can think of, is this function never runs. And when address line1 is actually null, it's used to see if a date was passed into one of the other fields. I am going to guess they're trying to sanitize some data they parsed from somewhere else.

    That first inner if can never run.

  • Bim Job (unregistered) in reply to DaveK
    DaveK:
    fjf:
    dkf:
    It's a good thing they don't have any customers living in March.
    If all of their code is like this, they may not even have any customers living in March.
    I promise you, life in March really does not count as "living". Trust me, I've been there.
    My grandparents were born there. You're right.

    But now, back to the big issues of life.

  • (cs) in reply to Anonymous
    Anonymous:
    Not sure what you mean about every string containing the empty string. If you call the 'Contains' method on an empty string (ie length=0), it will only match another empty string (ie length=0).

    That's basically what I meant. In other words, does "some random string".Contains("") return true or false? In some sense it's trivially true that it contains the empty string (that is, you can find a substring that matches the empty string--take any zero-length substring), but it's not necessarily a useful test. From what you said, it seems that it returns false.

    I know, I know, RTFM. I was just too lazy to go to MSDN.

  • (cs)

    I've seen two good suggestions as to wtf this is for: catching improperly parsed fields, and catching Excel formatting text as dates.

    It could also be part of a half-ass temporary address scheme: 123 Maple Street Smegmaville OH (Mar 2-Mar 4) Your mom's bedroom

    It wouldn't work, but with no idea what the application is supposed to do, this is as good a guess as any.

  • sino (unregistered) in reply to bob171123
    bob171123:
    fjf:
    Alex Papadimoulis:
    Aaron adds, Aaron adds, “I’m not exactly sure what thought process lead to this ...”

    I wonder why I wonder why nobody has commented on the double "Aaron adds" so far ...

    If we keep highlighting Alex's mistakes as WTFs, it's only encouraging him to sprinkle more of them in all of his posts. When the WTF in the article is not good enough, Alex's writing SNAFUs provide enough amusement.

    I should add that I'm not exactly sure what thought process lead to this. It's just what I think causes Alex's writing WTFs.

    He's trying to make Mark feel better about himself. Note the conspicuous absence of bowytched articles for the last week or so.

  • schmitter (unregistered)

    Two things, first I can't remember the last time I had to type in a month into any form, since they are all pull down selections, making this whole thing null and void. Second I am reminded of my retail days with a customer named Dawn Blow, who happened to live on Seaman Circle. Real name, real street, and yes she was real hot.

  • (cs) in reply to Pragmatopian
    Pragmatopian:
    <Useless Trivia>

    Other Prague street names doubling up as dates include:

    5 Kvetna (5 May)

    and

    17 Listopadu (17 November.

    Various streets are named after public holidays.

    </Useless Trivia>

    "Kvetna" would be "of April", I'm quite sure of that. Even tho I don't speak Czech, only a similiar Slavic language.

  • Buddy (unregistered) in reply to Quirkafleeg
    Quirkafleeg:
    Sad Bug Killer:
    Btw, what language is that? String, string and IsNullOrEmpty suggest C#, but the `for (String month : months)` is not C#-y. Anonymization gone wrong?
    C++ (well, C++0x, or C++1x as it should be known now) has that construct.

    Bloody hell, C++ can go fuck itself. Is there anyone on the planet who understands and uses 100% of its features? It's like marching the Chinese in single file, you'll never reach the end.

  • Bim Job (unregistered) in reply to Buddy
    Buddy:
    Quirkafleeg:
    Sad Bug Killer:
    Btw, what language is that? String, string and IsNullOrEmpty suggest C#, but the `for (String month : months)` is not C#-y. Anonymization gone wrong?
    C++ (well, C++0x, or C++1x as it should be known now) has that construct.

    Bloody hell, C++ can go fuck itself. Is there anyone on the planet who understands and uses 100% of its features? It's like marching the Chinese in single file, you'll never reach the end.

    Entirely different from Cobol, Algol, Pascal/ModulaX, dum dum dum Java, C#, and Pascal then.

    Not to mention PHP (which is woeful) and Perl (which is the very definition of <100%).

    You got a problem with this?

  • Buddy (unregistered) in reply to Bim Job
    Bim Job:
    Entirely different from Cobol, Algol, Pascal/ModulaX, dum dum dum Java, C#, and Pascal then.

    Not to mention PHP (which is woeful) and Perl (which is the very definition of <100%).

    You got a problem with this?

    |S| does not have an impact on whether A is a member of S.

  • Java Refugee (unregistered) in reply to schmitter
    schmitter:
    Two things, first I can't remember the last time I had to type in a month into any form, since they are all pull down selections, making this whole thing null and void. Second I am reminded of my retail days with a customer named Dawn Blow, who happened to live on Seaman Circle. Real name, real street, and yes she was real hot.

    I knew someone who had to make this move. She had a hard time getting a moving company to believe her for some reason.

Leave a comment on “October Road”

Log In or post as a guest

Replying to comment #:

« Return to Article