- 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
Erwin Schrödinger and Grace Hopper would have been funnier, for biologically obvious reasons. Apologies to anyone to whom the concept of sexual intercourse makes them vomit into their lunch.
Admin
The ejection of substance isn't cumming from my mouth... [color=white]...but from my ears[/color=white]
Admin
Obviously, we are not adding 2 numbers, we are just adding funk here. Whats the problem?
Admin
Admin
Admin
Agee.Probalby there a MutableBoolean passed to some distant class and needs to be updated at a later point while application is run. Actually quite smart.
So this one is a miss I guess, bound to happen some time too :=)
Admin
For some reason I'm feeling a strong urge to share my opinion about these particular WTFs with you. Each and every in this article are making sense to me. I'm not coding that way, but I see the reasons behind such code. Usually the reason is an unanticipated change. Since there is some PHP code, I'd expect something very filthy and utterly pervert, yet you've published a relatively meaningful code.
Perhaps that's because the average PHP coder wouldn't read this portal. I've had worked with some Indians, Russians, Germans, Pakistanis, and I've quite formed an opinion about their typical code output. The only thing worse than having such co-workers is having such co-workers and trying to deliver a usable and functional product.
Time management: 10% development, 30% struggling with Notepad++ because they are too stupid to learn how to use an advanced IDE (Eclipse), 25% struggling with SVN because they keep constantly overwriting changes of each other, 10% bug-fixing, 10% bug-fixing of previously applied bug-fixes, 10% bug-fixing of newly introduced bugs during the 2 previous bug-fixing sessions, and 5% looking up every single PHP command before its use at php.net because they are unable to use any proper IDE.
// I did quit already. Never again will I accept an offer from such companies. And this is a real WTF! :)
Admin
Well, the odds are against you in these sorts of arguments. At least the guy knows how to code his way out of a hat -- there are plenty enough out there who don't. The advice is "pick your battles".
I'm not even sure which point of this WTF you are arguing (and losing). There are so many.
The author of the isLoggingEnabled() is definitely showing a sign of intelligent life, putting up an intelligent facade around a ridiculously denormalized implementation.
The use of a run-time comparison for -1 is generally more readable than forcing an outcome using the pre-compiler. Mileage may vary per shop, but I read much more run-time code, and using #if forces a logical gear shift for me, let alone the syntax and indentation breaks.
Every now and then "static" macro's like MAX_ATTACHMENT get turned into calls to a global function -- remember errno -- and the more-poorly defined the macro, the more likely. A runtime comparison works better; most compilers are smart enough to recognize a comparison with a constant result.
Admin
I'm not sure that's enough of a reason to prefer the #if, but it is a benefit.
Admin
The funny part about the mutable boolean is that there is a chain of reasoning behind it that is at once perfectly rational and completely stupid.
Admin
1.1 was probably adding the copyright notice in 1984. The rest were likely adding a new date each time, incrementing the version even though NO non-comment changes were made. Some management is extremely anal about that practice.
Admin
百度</ A> [URL = http://www.sina.com]新浪[/ URL]
Admin
Except that's the BSD license... so this is an open source Hello World, that doesn't comply with it's own license since it does not reproduce the license text at run time.
Admin
Well, you're free to compile it, you just can't give anyone the class file without violating the terms of the license :P Of course the license terms allow you to modify the source code, so you could fix that problem if you really wanted to give someone a binary from this program.
All of which is made moot by the fact that the program is probably to short to actually be copyrightable.
Admin
What I find funny about the #define HEX(A) (0xA) is that it doesn't actually work. The second A is part of the constant hexadecimal number. It's EXACTLY the same as writing:
#define HEX(A) (10)