- 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
It's a TRAP!
Admin
It's missing FILE_NOT_FOUND.
Admin
For crying out loud:
public void addPersion(String name, boolean isMale) {...}
Please engage brain before commenting!
Admin
That would be male chauvinism!
Corrected: public void addPerson(String name, boolean isMale, boolean isFemale) { ... }
Admin
A co-worker's code is always full of crap like this:
UInt8 one = 1; UInt8 zero = 0; stream.write( one, UInt16(0x01) ); stream.write( zero, UInt16(0x01) ); stream.write( zero, UInt16(0x01) )
or
String sEmptyPath(""); if( sEmptyPath == sPath )
And I'm the idiot who needs to patch the shit when he's away for holidays! :P
Admin
Grovesy, that's horribly wrong. You're supposed overlay your answer with bit masks.
Sorry, but you just failed the interview.
Admin
D_DO_NOT_WANT_decode
Admin
Yeah but client code that uses this method is still ambiguous:
addPerson("Jaime", true); addPerson("Renee", false);
You'd have to jump to the source code (if you have it) or read the docs (if there are any). Meanwhile, this is always obvious:
addPerson("Jaime", Gender.MALE); addPerson("Renee", Gender.FEMALE);
I think there is an item on this in Effective Java somewhere.
Admin
Admin
enum gender { male, female, other, fileNotFound }
I guess we need to add another one in case of both being true:
shemale
Admin
See the following article: http://thedailywtf.com/Articles/Who-is-Kyle-Soze.aspx
Admin
I agree. Are you Mon Calamari, too?
Admin
Don't you mean:
public final static String INT_0 = "0"; public final static String INT_1 = Integer.parseInt(INT_0) + 1; public final static String INT_2 = Integer.parseInt(INT_1) + 1; ...
?
I'm leaving it as an "exercise for the reader" to figure out what to do with the NumberFormatException. ;)
Admin
it is obvious. women are always false.
Admin
I cried when I saw this.
Admin
Amusingly enough, I've seen this sort of thing. Fraunhofer IIS is selling it, in fact. Gave me many amusing minutes while it was trying to guess the gender of the people in the room. Here's the link if anyone is interested:
http://www.iis.fraunhofer.de/EN/bf/bv/kognitiv/biom/dd.jsp
Admin
I lol'ed.
Admin