- 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
C99
Admin
That's just some poxy newcomer. ANSI C FTW.
Admin
Or, wait, let me guess, you added some pointless non-standard extension method to the string class ("IsNotNullOrEmpty") and use that everywhere, confusing and infuriating everyone who doesn't know where the method is declared in order to enforce some nebulous idea of "readability" that only you understand?
You're awfully belligerent for such a nitwit. It seems like every post you make is thick on opinions and thin on facts.
Admin
Also, how does your code relate to the post you quoted?
Admin
Admin
Admin
ANSI C is C89/90. K&R predates that and is so damn forgiving with parameters etc. that it drives me nuts.
Admin
Sorry for being unclear. I was thinking of languages with a C-like syntax, not about C specifically.
Admin
At the previous developer I worked for, most objects had a SetEnabled() method that accepted a bool as the single parameter. The method also returned a bool indicating whether or not the object was successfully enabled.
It led to fun code like this:
It became second nature to read it after a while, but it still drives me nuts.
Admin
Admin
... I just can't believe this isn't a fake.
Admin
Admin
""Wow, what a complete dorko. "
I've never felt compelled to comment before but I have to agree.
What a complete dorko."
It's all in a name! Anyway, I feel much better today after having adjusted the medication. Cheers!
Admin
Admin
You could do:
but that's just a lot more verbose.The slight WTF is that PHP's boolean operators - unlike in C - actually only return booleans. So:
I'm with Capulet, I don't understand what's so wrong about
.Admin
NULLABLE BOOLS SHOULD BE SHOT!!!!!!!!!!!!
Admin
Quite true. It's silly 'cause I don't really have the choice but, as a C# developer, each time I have to use var=true I feel guilty and I end up writing a bunch of lines to explain why I commited such felony. :)
captcha: wisi. seems like someone lost his wig...
Admin
Sorry, are you saying comparing against true / false is advisable in C++?? I don't see why. In fact I can show you a case where comparing a bool against true may not do what one would expect, whereas just testing works fine.
#include <iostream>
int main() { bool b = false; unsigned char* p = reinterpret_cast < unsigned char* > ( &b );
}
Using Visual C++ 2008 this prints: b does not equal true b evaluates to true
Addendum (2009-10-09 14:39): Meh, I fucked up my code sample. Should have been:
#include <iostream>
int main() { bool b = false; unsigned char* p = reinterpret_cast < unsigned char* > ( &b );
}
Sorry.
Admin
Thank you for your sharing,I like this.
Admin
Beautiful you are, I believe would like tiffany jewelry
Admin
the comment on scientology is the money shot
Admin
Don't you mean:
Admin
XML is like violence: if it isn't working, you aren't using enough of it.
Admin
I cant say if this is the case....
I've been known to throw in stupid statements like this for debugging when I want to set a break point in debug mode.
Admin
Just this week, one of my fellow "developers" asked if there was some clever function that would easily reverse the sign on a number, like change a negative to a positive and a positive to a negative. I told him to put a "-" in front of it, and he looked confused. So I told him to multiple by -1, he thought for 10 seconds, then admitted this was really "clever".
Admin
return ( _booInpt ) ? false : true;
Admin
seems like this clever uncle is way past retirement age?
Admin
// Oh noooo! !!!smart;
Admin
WTF #4 is not allocating memory