- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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.
Admin
What percentage of WTFs do we think are caused by stringly typed data?
Admin
@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.
Admin
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 betweenFOR
andI
was necessary, but it wasn't necessary to put spaces aroundTO
.Admin
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.
Admin
TRWTF is throwing
RequestParameterNotFoundException
on a validation error. I'd expect it to be thrown if, you know, a request parameter was not found.Admin
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.Admin
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."
Admin
Of course, the real wtf is the typo that makes them Costants rather than Constants.
Admin
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
Admin
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.