- 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
"So the original developer solved a problem they'll never have, by re-implementing built-in methods."
My guess is that at some point in the development, there was one powerful stakeholder who had heard that Oracle Was The Best and was determined that nothing else would do. And so these methods were created to ensure that when the "inevitable" change happened, everything would be fine. Then that one powerful stakeholder got hit by a bus or, perhaps, their own ego, and disappeared from the pages of history, leaving only this method behind to mark their passing.
Who was that stakeholder? Why did they want Oracle uber alles? What happened to them? This is a mystery, but not a WTF. At most, it's a "didn't know there was a builtin that did this" ... really, really minor WTF.
Admin
You cannot use Oracle without Oracle abusing you.
Admin
So "abstractions that eventually didn't happen" is a WTF now? This sounds like TRWTF.
Also, the article is written very confusingly with who did what in the codebase. You're making me think that he has split personality disorder or something.
Admin
TRWTF is to have log as optional but then use it for log.Debug() and log.Error()
Admin
In these days where every project uses half a dozen in-house NuGet packages (and a few dozen third-party ones), you can't just delete a bad utility function. Sometimes deprecation is the only option, and you've gotta hope that the other devs are responsible enough to heed the warnings and fix the code that calls it.
Admin
While Remy isn't a german expert, I sure am (not really, it just happens to be my native language).
So yeah, the comments read:
And the second one:
And, if you paid attention, you'd noticed that "example" means "Beispiel" (/ˈbaɪ̯ʃpiːl/) in German. Now you learned something! (And yes, the capitalization is important, in German ALL nouns are capitalized, which of course is the real WTF.)
Also, I am by no means an English expert and I paraphrased the comments. So please excuse any crudeness or butchering of the English language. I did mean no harm!
Admin
I wonder if at one time somebody cut and pasted in some functions nicked from an Oracle implementation and couldn't be bothered to convert them properly?
Could also have been an upstream or downstream partner they were exchanging data with.
Still a WTF either way. Classic case of thinking you must be the first ever dev to encounter an obvious problem.
Admin
I'm confused by the line of code where they assign the formatted GUID: string newId = $"{... What's the dollar sign doing there? This is Java, right? Is that a typo or some weird operator I'm not aware of?
Admin
Also, apparently I'm confused about how to format my comment, the line I'm asking about is:
string newId = $"{...
Admin
No this is C# string interpolation, search for it, you'll see the syntax documentation.
Admin
Ah, thanks. Such similar looking code, it was hard to tell.
Admin
In Java, you would have @Deprecated instead of [Obsolete].
Admin
Also, when you (initially) import others' code into source control, you should always set an author name that is not you. In git this is very easy (as it distinguishes between --author and --committer), for SVN you probably either really need a dummy user or you'd have to use some post-revprop-change hooks. But it's doable and definitely helps blaming later.
Admin
Will it still work if the logger is set to the default value of null that’s declared in the method signature?
NTRWTF, but a nice pseudo-WTF.
Admin
An even bigger WTF is that in Oracle a GUID is not even stored as a VARCHAR2(32). It can be represented as a VARCHAR2(32), but it is stored as a 16-byte RAW type.
This code looks like stack-overflow-copy-paste style of programming.