- 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
CHashMap comments; comments.addItem("", "frist")
Admin
Comment held for moderation against its will at a secret blacksite.
Admin
Somehow I can feel the urge to search CHashMap for a
char *operator &()
member function...Or an overloaded version of
AddItem
that does something similar to that when you give it a CHashMap by pointer instead of achar *
.Admin
I'd also like to point out that in almost every possible circumstance,
operator &()
is more WTF than anything else you can do with C++.Admin
Bah. The only urge I feel is to stop reading TDWTF because this is just too painful to read. Literally painful.
Don't get me wrong, it's an excellent article that fully meets the criteria for the site . . . but I'm hitting myself over and over again and wondering why it hurts.
Admin
Not so Brian’s co-worker, Dagny. Dagny wanted to write some C++, but didn’t want to learn that pesky STL or have to master templates.
Templates are fine and all, but in fairness mastering them presumably involves the single most Lovecraftian region of technical complexity in a mainstream language - template metaprogramming.
Admin
Why did I read CrashMap?
Admin
Extra added WTF is storing monetary values in a double!!
Admin
hammer/foot-gun: n. A multipurpose tool suitable for hitting yourself in the head and shooting yourself in the foot at the same time.
Admin
Dagny: "Hey, Brian. Maybe you can help me out with this. I keep hitting myself in the head, but I can't figure out why my foot hurts."
Admin
"Dagny also considered themselves a “performance junkie”,"
Apparently Dagny is some manner of gestalt organism.
Admin
In all fairness, std::unordered_map is a fairly new addition to the language (C++11), so it's not uncommon to find variants of "CHashMap" in older codebases. But hopefully most of them are better written than this one.
Admin
Almost as bad as using a dynamically-typed language!
Admin
it’s worth mentioning that our DB stores dates in the typical format: “YYYY-MM-DD hh:mm:ss”. cvtUTC is a function that converts a date-time string to a time_t value, and FormatTime converts a time_t to a date-time string.
How else are you transpose the string value?????
Admin
"operator &() is more WTF than anything else you can do with C++."
That can actually be useful....MANY bigger WTF's are possible...... Uh On...here come those flaming nasal demons again...
Admin
This code feels waayyy to familiar to be comfortable.
Except the variant I know also added persistence to disk (why only crash once if the corruption can crash the next twenty versions too?!), and uses C-style casts instead of somewhat type-safe converter functions.
Admin
You're not alone in struggling to parse it, I thought someone had badly misspelled "cache".
Admin
Nobody even mentions the amountDue += 0;
Admin
I agree that there are some specific cases where
operator &()
works out OK (Microsoft's ATL COM pointer wrappers spring to mind), but I've seen it used in some other cases where ... stuff ... happened, and it was monstrously hard to work out why.Case in point: someone created a buffer-containter object. He thought it was a good idea to have an
operator &()
on the object that returned achar *
that pointed to the contained buffer. I used the object in an innocuous situation, and the compiler barfed about 10K of error message owing to an unexpected change in pointer type deeeeeeeeeep in the bowels of the STL. Sadly, the guy worked in the office on the other side of the Atlantic from me, or I'd have gone to visit him with a Big Stick, and I wouldn't have bothered to speak softly either.Admin
At least dynamically-typed languages have types. This is just cramming everything into one type, the so-called "stringly typed" approach.
Admin
Static inferred typing: It's a duck if and only if the system knows it to be a duck. Agree or Duck off.
Static explicit typing: It's a duck if and only if you have declared it to be a duck. Ducklare or Duck off.
Dynamic typing: It's a duck if it walks and talks like a duck. Duck the Ducklarations.
Stringy typing: It's a duck as long as you think it's a duck. What The Duck!
Admin
Wait, the article's title isn't "CrashMap"?
Admin
Look(); Look(); CHashMap(); CHashMap(); Run();
(Evil snickering)
Admin
You know a WTF is a good one when it also monkeys about with time/date for no good reason.
Admin
That is not the keyboard's intended use
Admin
operator&
andoperator,
are pretty tame in comparison tooperator||
andoperator&&
which are no longer short-circuiting.Admin
Why is the syntax highlighting so bad?