• Grzes (unregistered)

    Where is "FileNotFound"?

  • some guy (unregistered)

    Yes, that is terrible code. No, I don't want to work there.

  • some guy (unregistered)

    Also, they can easily adapt this to cover FILE_NOT_FOUND, so that's a plus.

  • Tim (unregistered)

    not to mention the isYesNo function is very badly named. I would expect it to return true if the parameter is of type YesNo

  • Sauron (unregistered)

    N̷̹̞͚̣͔̩̻͈͇̺̬̬͕̠̞̣͕̙̔̊̎̆͗̾̃̑̄̔̄͐̽̔̍̏̑͌̍̊̚͘̕͜͜͝O̵̥̭̦̊́Ǫ̵̛͉̯͚̱̮̫̱͙̮̘͙̬̫͈̭̱́̃̓̅̈́̍̎͌̽̾͋̎͋͐̈́̐̑̒̿̾̚ͅÔ̸̧̙̼͎̖͕̗͚͔̖͉͕̝͔̰͓̦̥̯̕͜͝O̶̢̩̼̱̺̍̐̀̐̈́͋̄͒̽͌̐̽͋͂̕͘͝͝Ȯ̸̟͗̀̓̌̿́̓͑̿̾͊̓̈́̈́͝͝Ò̶̡̡̟̰̫͉͇̞͔͎͚̩̳̥̫̺͖̠̘͇̳̫̪͔͆̈́̕͜͜Ơ̷͚̲̩̜̙̩͖͓̯̱͇̜̑͛̈̾̈̈́̅͆́̿̽̈́̄̍̌̽̀͆̆̕͝͠͠O̴̢̨̡̭͓̟̝͎̱̘̫̟̩̲̜͖̹̥͎͍̳̱̦͙͊͒̓́̀̃̃͂͋̀̏́͒̈́͑̌͐̋̕̚Ǫ̶͔̫̣̼̹̗͉̺̣͆̂Ȯ̴̲͎̼͖́̑̈́́͗̄̀́͆̏̈́̄͑͐̔̾̋͋͊́̀̕̕͝͝Ǫ̴̫̺̳̩̩̠͕̦͉̰̫̳͍̠̦̫͕̥̐Ó̵̙̗̖̤̘͚̪̒̂͌̐͂̉Ȯ̶̧̢͖͉͓̻̥̣̫̼̖̘̖̫̺̣̀̅̀́͐̇͊͑́̀͗̚͜Ơ̶̧̨͎͙͓̪̥͇̦̹̖͍͎͚̯̞̰̯̱̯̟̆̔̉̄̎̀́̃͂̊̆̃͒̄̋̒̈̋͑̑͆̒͠͝ͅO̶̢͉̤̟͖̣͚̻̠̳̟̦͈̣̗̩͈̯͌̍̑̄͌̕͜ͅO̵͚̿͆̔͑̈́̍̈́̓Ŏ̶̧̡̢̢̡͕̭͔̫̦̤͎̲̬̤̖͚̤͍͉͎̼͚͓̹̄̈͌͂͘͝Ǫ̵̧̢̲̹̞̩̟̗̙̗̳̦̣̼͈̣̖͎̫̭̱̱̙̼̹͗͆͑̌̀͛̅̀̓̈́͐̇̒̿̎͊̄͊̀̀̀̌̕̚͝͠͠ͅO̷̠͙̗͔̖̺̟̞͔͈̺̫̜̘̓̀͌́͛̃̽̎̈́̓̏̌͆̾͊̒̆̚̚͝͠͝͝͠͝O̵̧͈̬̯͚̪̺͙̫͉̲̣͕̙̣̫͛̌̌̽̽͂̀͛́͠ͅͅO̴̹͉̮͖̯̜̞͉̠̳͚̜͎͖̫͍̖̝̳͆̏̊͛̓̋́̿̑̇̉̎̿̾̆̃́̎̏͂͋́͗͂̓̓͜Ó̷̢̨̡̨͍̻̯̙̙͈̭̜̰̺̘̫͙̖̥̣̰͕͎̺̖͒͒

  • (nodebb)

    The most fun part is that it does not round-trip.

    If you start with a truthy YesNoType, then toYesNo(fromYesNo(myTrueValue)) will make it falsy, because it returns Yes but compares only with Y.

  • Chronomium (unregistered)

    TRWTF is the code being double-indented. Every indent level is 2 tabs.

  • Duston (unregistered)

    And where is the XML config file? It's gotta have an XML config file! Because this might be a multi-cultural app that needs "Oui" and "Non", right?

  • (nodebb) in reply to Chronomium

    The indentation is a TDWTF issue, it happens all the time here.

  • StackV (unregistered) in reply to Medinoc

    It's a confounding function, because fromString() exists and is used everywhere else. So they added toYesNo() just for "Y" instead of having fromString() handle it…

  • Bill T (unregistered)

    There probably should be an entire category of issues at The Daily WTF, how not to handle yes/no. Not really related to this one, but a previous project I worked on used shell scripts to prompt for parameters for a process, then prompted if you wanted to continue ("Proceed? <y>es or <n>o?") Then, it compared the response to a CAPITAL N, which was the only exit condition. Type 'Y', it would continue. Type 'n', it would continue. Type 'No', it would continue. And the consequences of continuing when you didn't want to took a lot of work to unwind.

  • mihi (unregistered)

    My assumption would be that the YesNoType comes from a XML binding framework (e.g. JAXB) for a third party schema that defines a xsd:string restriction with enum values of "Yes" and "No". But even these enums are proper Java enums with generated constants, so (unless you are marshalling them from/to XML yourself), you don't need to use the generated fromString() and toString() methods.

  • löchlein deluxe (unregistered) in reply to Chronomium

    "In the tab-vs-4-spaces debate, I compromise by indenting by 4 tabs" is up there with array indexing starting at 0.5.

  • (nodebb)

    Funny detail: The title looks funnier here in the comments and in the RSS feed, because the joke gets lost when the webpage formats it in all-upper-case.

  • Neveranull (unregistered)

    These guys would probably have a Cancel button, and when you pressed it you’d get a popup window with “Cancel: Are you sure? :with three possible answers :“Yes”, “No,” and “Cancel.”

  • Barxa973 (unregistered)

    Why was the YesNoType source code not included in the post? I bet it is a gem as well!

Leave a comment on “Yes, No, NO NO NO NO”

Log In or post as a guest

Replying to comment #:

« Return to Article