221: Random Number

explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
Random Number
RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.
Title text: RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.

[edit] Explanation

The comic specifies a function (in a C-like syntax, perhaps C++) that, when called, returns a random number. Most functions of this form are random number generators, implying that they return a range of different random numbers. Here, the programmer has instead created a function that just returns a single "random" number - one that the comment claims is chosen by rolling a dice. This function is essentially worthless, as it could simply be replaced by a "4" wherever it is used. (In fact, most modern compilers would do this automatically.)

The IEEE is the company organization responsible for maintaining a number of computer standards. An RFC, or Request for Comments, is a formal document put out to computing experts by IETF in the hopes of becoming a future standard. However, RFC 1149 was an April Fools' joke, suggesting that carrier pigeons be used to transmit Internet packets. (Ironically, although the RFC was written in 1990, a homing pigeon with a couple microSD cards tied to its leg might well be faster than your typical consumer Internet connection in the US today.) There is no RFC 1149.5.

[edit] Transcript

int getRandomNumber()
{
    return 4;     //chosen by fair dice roll.
                  //guaranteed to be random.
}
Comment.png add a comment!

Discussion

The syntax looks like perfectly valid java to me.213.64.1.189 22:00, 11 March 2013 (UTC) As a proof of good joke, RFC 1149 was successfully implemented several times. -- Hkmaly (talk) 08:55, 11 May 2013 (UTC)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
New Server Fund