- 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
If it was Javascript I would write it:
It ensures googleId is null if it was undefined, null or '' previously. Of course if the intended use for the null value was something like this later: Then the first line is not needed as you can just simply write:Admin
Monsters from the googleId might then destroy the 'Don't be evil' mantra.
Admin
FTFY
Admin
I am new to tdwtf, but I like it.
Just wanted to mention that most of this horrible code in this issue is optimized by the compiler anyway, isn't it?
Admin
Nope. Most of it just blows up in the user's face.
Admin
The sad part about some broken VMs I can name, possibly still including PHP, is that the pattern is justifiable.
Admin
cAMELtOEvARS cONSISTENTcODEfORMATTING eTC.
-hARROW.
Admin
This reminds me of a CS professor I had in college. He was from Germany and had a thick accent. His grammar was understandable, but sometimes hilarious.
One day he was giving a lecture on probability:
"OK, say we flip ze coin. Now, say I want head." I smile at one of my classmates. A few minutes later "OK, so all I want is head." Now I snicker a little and I'm having trouble not laughing. I look around at the rest of the 19 year olds in the classroom and the situation is dire, everyone is about to bust out laughing. After he says a couple more variations of "All I want is head" he realizes that something's up and next time it's, "so now all I want is tail" and everybody's laughing out loud.
Another time he was talking about dynamic programming and the problem of loading packages of different sizes into a truck. He's trying to call the algorithm the packer but it comes out as pecker. He brought the house down once he started talking about using recursion, asking his "little brother" to do some of the work for him: "SO now I'm going to use my little brother's pecker..."
Admin
Admin
Camel Case is great until you start writing methods with names such as the clbuttic: bool PenIsUp() { return !PenIsDown(); } bool PenIsDown() { return !PenIsUp(); }
Admin
Anyone who can't see what the GoogleID comment is doing needs to brush up on some modern languages. I could immediately determine the intention of that code and why it was doing what it was doing.
Like it or not, loose comparison is becoming extremely common thanks to languages like PHP and javascript. Yes, the real WTF may be the language itself, and it may be stupid, but that doesn't change the fact that many modern languages are heading that direction and you need to at least be able to interpret code that way in your head when necessary, or start preparing for retirement.
Admin
As usual, the "Real WTF" (TM) lies in the comments:
Most commenters obviously did not get that
"Camel toe" is a mix-up with "camel case", a naming convention for source code identifiers, in which adjacent words in otherwise completely lowercase names start with a capital letter to increase readability: thisIsACamelCasedIdentifier "Camel case" thus pertains to the "humps" inside such names.
"Camel toe" is something completely different and quite a well known meme on "teh internets": http://www.urbandictionary.com/define.php?term=camel+toe
The russian guy was obviously thinking about something else when writing this ;o)
Remember, the internet is for p0rn! ;o) http://www.youtube.com/watch?v=T-TA57L0kuc
Admin
Incorrect.
Perl: http://stackoverflow.com/questions/137487/null-vs-false-vs-0 Javascript: http://www.bloggingdeveloper.com/post/JavaScript-null-vs-undefined-The-Difference-between-null-and-undefined.aspx
and so on, it is very common in dynamically typed languages that 2 values may be equal under == but have different types and be not equal under some other operator such as ===
Admin
No. It doesn't matter what super or interface type you choose to "view" an object as, it matters what specific type the object actually is. That's the whole point, really. Your way would make inheritance completely useless.
Admin
Right! I turned crazy by trying to force sanity into that code.
Admin
Right! I turned crazy by trying to force sanity into that code
Admin
Admin
http://en.wikipedia.org/wiki/Cameltoe
Admin
That doesn't mean that your operators makes sense just because you defined them. Who are you, after all, russian coder?
Admin
Since 1917 when we conquered Asia steppes
Admin
VB6?
Birds?
::evil swamplike flashbacks::
Admin
a question to native speakers: how would you rewrite the Russian guy's comment in a proper way?
Admin
No, It doesn't.
super.toString() // call method toString defined in parent class of this instance ((Object) this).toString() // this is Object & call method toString on this instance