this post was submitted on 16 Jan 2024
113 points (99.1% liked)

Comics

462 readers
1 users here now

A community for sharing comics related to programming

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 11 months ago
MODERATORS
 

Transcript:

[A computer program.]

int getRandomNumber()
{
   return 4; // chosen by fair dice roll.
             // guaranteed to be random.
}

Hover Text:

RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.

top 7 comments
sorted by: hot top controversial new old
[–] Lmaydev 1 points 11 months ago

It is a random number and returning the same number every time is technically valid. Just a poor implementation.

[–] [email protected] -1 points 11 months ago (1 children)

Didn't know that. That's kind of funny

[–] BetterDev 2 points 11 months ago (1 children)
[–] [email protected] 1 points 11 months ago (1 children)

RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.

I didn't know 4 was the official random number.

[–] BetterDev 1 points 11 months ago (1 children)

It's not. RFC 1149 is an April fools day joke about the protocol "IP Over Avian Carriers" and RFC 1149.5 doesn't exist. He's making a joke here.

[–] [email protected] 1 points 11 months ago (1 children)

Ahh I missed that reference. I remember reading the xkcd about the carrier pigeons a while back

[–] BetterDev 2 points 11 months ago

Ah gotcha. Glad I could clarify. For reference, its easy to look up RFCs by just visiting the IEEE website: https://datatracker.ietf.org/doc/html/rfc1149