• some guy (unregistered)

    Frist of all, even valid UUIDs may be represented in different ways (braces, parentheses, hyphens) and not all of them may end up as 36 chars. Second of all, why not just parse the thing.

  • (nodebb)

    What percentage of WTFs do we think are caused by stringly typed data?

  • (nodebb)

    @Dragnslcr.

    You beat me to it. ALL of this is due to using stringly-typed data as the main way we pass data from client to server. In an era when client-server and HTML is WAG 90% of the total new code space and much code is written in auto-converting typeless language whos value-handling reminds me of nothing so much as GW-BASIC with longer variable names.

    Yes, there are libraries and protocols to abstract (some of) that away. Good luck finding one all your devs can / will use that will fit all your use cases, all your endpoints, and that you can count on still being there for the decades-long lifecycle of commercial software.

  • (nodebb) in reply to WTFGuy

    much code is written in auto-converting typeless language whos value-handling reminds me of nothing so much as GW-BASIC with longer variable names

    Longer variable names (although GW-BASIC variable names were limited to 40 characters, not just two(1)) without the type suffixes... $ = string, % = integer, ...

    (1) This was why the GW-BASIC parser didn't recognise keywords that weren't separated from variable names by a space on both sides. In FOR I = Y*(X+1)TO-Z, the space between FOR and I was necessary, but it wasn't necessary to put spaces around TO.

  • (nodebb) in reply to Steve_The_Cynic

    Limited to characters or significant characters?

    A lot compilers/interpreters allowed for longer names but only a fraction was considered significant (the least of the characters were just ignored). A good example were a lot Borland compilers at the time, where technically the length of variables were 255 but only 32 characters were significant.

    I wonder if GW BASIC had something similar going on, I remember C64 BASIC allowed over 64 characters but only the first two were significant. That was pretty common in the last millennium when Trump was just the guy from Home Alone 2.

  • Maia Everett (github)

    TRWTF is throwing RequestParameterNotFoundException on a validation error. I'd expect it to be thrown if, you know, a request parameter was not found.

  • Naomi (unregistered) in reply to Maia Everett

    Agreed. If I had to guess, I'd guess that it was originally just a null/empty check, and the "validation" was added later. Still a WTF, imo; even a basic RuntimeException is so much better than an exception type that's actively misleading.

  • Officer Johnny Holzkopf (unregistered)

    Also: "not distinguishing between whether or not the input was missing or invalid" is a typical source for helpful error messages like "Oops, an error occured! Haha! Please try again later."

  • (nodebb)

    Of course, the real wtf is the typo that makes them Costants rather than Constants.

  • (nodebb)

    You have to be careful going down the "it's just a large integer" road. A word document is just a single very large integer from one perspective, but probably not a very useful one

  • DB guy (unregistered)

    UUIDs are large integers, but sometimes it's better to represent them with strings. I've encountered a database with a UUID column type that performs better when using strings to hold UUIDs.

Leave a comment on “Uniquely Validated”

Log In or post as a guest

Replying to comment #:

« Return to Article