cellio: (sheep-sketch)
Monica ([personal profile] cellio) wrote2006-10-03 08:42 pm
Entry tags:

torture bill summed up in C

From [livejournal.com profile] patrissimo, who got it from others:

It occurs to me now that the whole 94-page bill really amounts to a common, one-character programming error.
if (person = terrorist) {
   punish_severely();
   } else {
     exit(-1);
   }

Uh, I don't get it...

[identity profile] rob-of-unspace.livejournal.com 2006-10-04 12:53 am (UTC)(link)
There's obviously something wrong with that, based on the setup, but I don't see it. It has been a while since I've C'd, and most of that was C++. Help for the clueless?
goljerp: Photo of the moon Callisto (Default)

Re: Uh, I don't get it...

[personal profile] goljerp 2006-10-04 12:36 pm (UTC)(link)
Actually, while I saw the bug (I'm a Java person, not so much C/C++), in Java I think the compiler would complain about the code as written. Unfortunately, I think the current supreme court is much more likely to let that pass than the Java compier.

[identity profile] zare-k.livejournal.com 2006-10-04 01:30 am (UTC)(link)
Heh heh, excellent.

[identity profile] schulman.livejournal.com 2006-10-04 01:34 am (UTC)(link)
Oh, that's beautiful.

(For tragically depressing values of beautiful.)

[identity profile] metahacker.livejournal.com 2006-10-04 01:50 am (UTC)(link)
I want a type-safe administration.
sethg: picture of me with a fedora and a "PRESS: Daily Planet" card in the hat band (Default)

[personal profile] sethg 2006-10-05 12:49 am (UTC)(link)
And these are the same guys who don't want us to implement a subclass (ahem) of Marriage that takes two Male or two Female objects in its constructor....

[identity profile] nsingman.livejournal.com 2006-10-04 02:01 am (UTC)(link)
They'd have caught the bug (assignment operator instead of equality test) had "terrorist" been defined as a constant, and the condition been written "if (terrorist = person)."
:-)
siderea: (Default)

[personal profile] siderea 2006-10-04 02:18 am (UTC)(link)
*snorfl*

Brilliant.

[identity profile] mhnicholson.livejournal.com 2006-10-04 02:50 am (UTC)(link)
I am so meming that.

[identity profile] mrpeck.livejournal.com 2006-10-04 03:29 pm (UTC)(link)
It is so hard why I laugh at these things when I'm in our computer lab.
jducoeur: (Default)

[personal profile] jducoeur 2006-10-04 04:28 pm (UTC)(link)
That is beautifully subtle. I know C well, and it still took a minute for the "pun" to sink in. (It's playing on the nuances and ambiguities of the language, therefore it's a pun. A double-entendre, even...)

[identity profile] http://users.livejournal.com/merle_/ 2006-10-08 06:44 pm (UTC)(link)
Most excellent.. and I hate to admit how often that one character has caused me grief and woe in JavaScript.