Home Original Content Funny Pictures Funny GIFs YouTube Funny Text Funny Movies Channels Search

hide menu
What do you think? Give us your opinion. Anonymous comments allowed.
User avatar #11 - jokeface ONLINE (07/01/2013) [-]
I haven't had a programming lesson since 2007, but I think the person who posted the programming joke messed it up. Don't "if-then" statements only work if you include the word "then" after the conditional clause?
User avatar #16 to #11 - Korosia (07/01/2013) [-]
Only in some languages, like python and basic. Most languages wouldn't. Ie,

IF InStock(eggs) THEN buy(eggs);

versus

if(InStock(eggs)) {
buy(eggs);
}

The joke still doesn't really make sense, because there's no way a programmer would interpret that to mean he should keep looping his instructions until he buys eggs, which is what the joke implies. You would need to add some kind of while(!eggs) loop in to get the behaviour described in the joke, and I don't see why anyone would do that...
#21 to #16 - Mumford (07/01/2013) [-]
Nope i think you've got it wrong. It's not meant to be a loop it's morely an addition. The programmer is to buy a loaf of bread. The condition is that if theres eggs which there usually is in stores he's to buy a dozen. However in a program it'd read it as.

IF InStock(eggs)
{
buy (dozen) loafs;
}
#12 to #11 - rdobet (07/01/2013) [-]
It's implied. I agree with you, but it's still hilarious.
 Friends (0)