- 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
Who publishes an API, has a contract. For life. Written in blood.
Admin
Fristz!
Admin
Your API is everything you expose, nit just what's documented. Someone somewhere will take a dependency on all of it, including your quirks and bugs. It was ever thus, but the advent of the web means even "internal" code has a lot of publicly facing utput and public consumers.
Admin
Wrapping success responses like this which are returned over HTTP, while unfortunately quite common, is the real WTF as it doesn't solve any real problems.
Wrapping failures in a standardised result format is a good idea, but using your own "made up" format is a WTF, you should instead be returning an RFC7807 compliant Problem Details for HTTP APIs result.
Admin
Frist comment not held for moderation?
Admin
Frist comment not held for moderation. I hope.
Admin
Comment held for moderation.
Admin
I don't know whether that stereotype still exists, but yes, many of my colleagues couldn't spell to save their lives. However, it's not just programmers, it's the sales managers as well. Sometimes I think I'm the only exception.
Admin
I'm a fan of returning 204 if all I want to return is success
Admin
Ah ! The sweet spell of Sucess !
Admin
Next they can have the intern clear up all the misspellings in their code that say
Referer:
. I'm sure that won't cause any issues at all.Also, relevant XKCD: 1172 "Workflow"
Admin
So true... Including a descriptive name together with a numeric code sounds like a good idea only until people start parsing the string. Or when people parse a browser version number as a string. Which probably just shows, that even adding a new numeric code will cause breakage, as long as it has any sequence of digits in common with an existing code...
But yes, anything, once publically available, can become a feature people rely on. Another favorite example:
Admin
This is why HTTP 204 No Content exist. Indicate success but no with response content needed.
Admin
Except in the real world this is usually not useful as there's almost always more information needed that can't be captured in a single response code regardless of a failure or success.
Admin
Spolsky has an entire blog entry about that deliberate Excel date bug. https://www.joelonsoftware.com/2006/06/16/my-first-billg-review/
Admin
so the third case just hangs on an error, right?
Admin
XKCD 349, surely!
Admin
Or (far, far) worse,
Refferer:
...Admin
I had to maintain some software that needed to check the Windows registry for the existence of another 3rd party program. The registry key was "Intallation Path". So... sigh... fine. Apparently someone filed an issue with the 3rd party developer and they fixed the typo in a later release. Great, now I have to search for two registry keys because both versions are widely used in the wild. Yeah, first world problems...
Admin
Czommentz held forz sucessfull modzerasciontz. See refferer errer codez 404½+1i².
Admin
Reminds me of the HTTP "Referer" header, spelled incorrectly by the early web server authors, but subsequently baked in to the protocol as the permanent spelling.
Admin
Reminds me of a guy who wanted to fix a typo in a string in a binary framework. I pointed him at a hex editor, and warned him that the string absolutely had to remain the same length or shorter, lest Bad Things Happen.
The typo fix meant increasing the string length by one character (changing "StarTime" to "StartTime"). He ignored my warning and made the change.
Sure enough, the "fix" didn't work. He then said that the string after that one was important else he'd steal a character from that, which would have led to... interesting results.
The quality of education in IT professionals these days does not seem to be particularly high...
Admin
The real WTF is misusing the outer protocol (HTTP) codes for content response. E.g. 404 means, the URL you requested does not exist. It should NOT mean, that the page exists, but your database has no entries for a requested items.
What's next, using an process exit code as the size of a file you tried to open?
Admin
Ah yes, that reminds me of the time when our monitoring fell over because the output of yum suddenly had a new (grammatically valid) "," in its output.
Admin
That's what you get when your developers are educated from the middle of the skill tree as opposed to the bottom. People like me who started with C or Assembly would newer make such a mistake because we understand what is going on under the hood. But if you have newer touched anything more down to the hardware than Java or Python than you really can't be expected to know or even care about things like that until you suddenly have to. And than you call one of us to fix what you can't.
Admin
Use 1904 date system: Changes the starting date from which all dates are calculated from January 1, 1900, to January 2, 1904.
Admin
Out CS curriculum:
Addendum 2023-09-28 05:07: Your markdown doesn seem to support the regular
syntax for
Addendum 2023-09-28 05:08: Or rather the style-sheet? The previous edit contained
Admin
How many English words have a different American spelling from the standard British Commonwealth? That alone can make it hard to be sure an API text string matches what people expect.
Admin
That's a case of Hyrum's Law if I've ever seen one.
https://www.hyrumslaw.com/