There is a new article up on Kuro5hin called Code Humor Challenge.
Overall, it talks about some of the weirdo code that people do write and those which do end up in production systems ...
The author starts of with a few examples and one of them which stood out was an IntWrapper method that wraps the Integer type. Oh yeah ... This is how it goes ...
public class IntWrapper
{
private final String value;
public IntWrapper(int p_iValue)
{
this.value = p_iValue.ToString() ;
}
public String GetValue()
{
return value;
}
}
You can't wrap the primitive Int better than that .. Can you ?!
And the best one yet is this particular post in one of the comments .. I loved the comment in the code ! Wow !
From a threaded tftp server written for class, I created a 'pocket' datatype that consisted of a tftp packet and a socket:
From a threaded tftp server written for class, I created a 'pocket' datatype that consisted of a tftp packet and a socket
struct pocket {
struct packet * p;
struct sockaddr * s;
};
(note: this was so I could pass it as one argument on the stack, using thr_create)
Hence, this comment (shamelessly stolen, apologies to Dr. Seuss and the original author(s)):
/*********************************************************
If a packet hits a pocket on a socket on a port,
And the bus is interrupted as a very last resort,
And the address of the memory makes your floppy disk abort,
Then the socket packet pocket has an error to report!
*********************************************************/
WTF ?! I kept laughing my guts out on this one ... Sheer poetry and still conveys the meaning ... I wish i could write comments like that !
Read on ...