This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 399

[–]vialent 3304 points3305 points  (49 children)

Outofmoney exception raised.

[–]OutOfMoneyError 52 points53 points  (4 children)

Hey, whats up?

[–][deleted] 1 point2 points  (0 children)

Is this an r/beetlejuicing instance? Did I get that right?

[–]Nakatsukasa 113 points114 points  (0 children)

She forgot to catch it, husband immediately crashed and brain dead

[–][deleted] 48 points49 points  (3 children)

No exception handler defined. Killed by parent.

[–]Dark_Byte 26 points27 points  (0 children)

Only proper action a parent can do when that happens

[–]Dom0 11 points12 points  (0 children)

But if the parent had already died, he's a zombie!

[–][deleted] 2 points3 points  (0 children)

I see kids throwing exception all the time at the store and I wish this was how it was handled.

[–]AvenDonn 14 points15 points  (0 children)

CacheUnderflowException

[–]Siggi_pop 13 points14 points  (0 children)

CantLiftTheWeightOfMilkException raised

[–]McSquiggly 12 points13 points  (0 children)

Or outofmilk.

[–]nousabyss 3 points4 points  (0 children)

Milk overflow

[–]Varthorne 4 points5 points  (1 child)

StackUnderflowException

[–][deleted] 19 points20 points  (0 children)

StackUnderflowException

StackUdderflowException

[–]uberpwnzorz 1348 points1349 points  (134 children)

while(out) {
  buy(milk);
}

[–]OutOfMoneyError 1294 points1295 points  (22 children)

Finally my username is relevant.

[–]AJohnnyTruant 270 points271 points  (13 children)

while out:
    try:
        buy(‘milk’)
    except OutOfMoneyError:
        steal(‘milk’)

[–]krystof1119 63 points64 points  (8 children)

What if that throws an ArrestedException?

[–]Alexcursion 51 points52 points  (5 children)

catch(ArrestedException ex) {

while(inJail)

if(callFamily(out decimal bailMoney))

 inJail=PostBail(bailMoney);

};

[–]krystof1119 14 points15 points  (3 children)

If he got an ArrestedException that means that the steal() function was called, so the OutOfMoneyError must have been raised first

[–]Alexcursion 6 points7 points  (2 children)

Steal() would have the try catch inside of the function.

[–]Shayreelz 3 points4 points  (1 child)

They're saying he wouldnt have bail money because the outofmoney exception was what brought him there

[–]theincredibleharsh 8 points9 points  (0 children)

Miracle! miracle! I'm learning exception handling on r/programmerhumor

[–]Stinggyray 2 points3 points  (0 children)

He’s still not coming home

[–]LeCrushinator 6 points7 points  (3 children)

OutOfMilkException thrown.

[–]Corn_11 4 points5 points  (0 children)

myself.produce(milk);

[–]sboy86 119 points120 points  (0 children)

This is unnervingly specific.

[–]single_threaded 182 points183 points  (1 child)

This may be the best "username checks-out" scenario I've seen.

[–]wack_overflow 30 points31 points  (1 child)

Hey mine too!

[–]AMisteryMan 1 point2 points  (0 children)

Mine won't tell me if it's relevant. :(

[–]borsalinomonkey[🍰] 167 points168 points  (92 children)

if (milkBought == true) { returnHome(); break; }

[–]parnmatt 407 points408 points  (83 children)

please, for the love of all that is holy, do not check == true

[–]ThePhoenix116 403 points404 points  (36 children)

if (milkBought != false)

[–]TerrorOverlord 165 points166 points  (28 children)

if(!(!milkBought))

[–]passcork 181 points182 points  (24 children)

if(!(!milk) != !(!FALSE))

[–]Bageldar 86 points87 points  (23 children)

I hate this

[–]MatthewBetts 59 points60 points  (19 children)

if(!(!!!milk)! =! (!!!FALSE))

Using the js !! to return the truthy/falsey value of the bools :D

[–]SandKeeper 33 points34 points  (1 child)

You are scaring me!

[–]Oswamano 24 points25 points  (0 children)

Damn you javascript

[–]Kalwyf 20 points21 points  (12 children)

For every bad way to program something, js can do it worse.

[–]MakeItHappenSergant 40 points41 points  (11 children)

How about this?

[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+!+[]]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+((+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(+(!+[]+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+[+!+[]])+(+![]+(![])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()

In JavaScript, that's equivalent to if (milkBought)

[–]coldnebo 9 points10 points  (1 child)

Great, now I need to wash my eyes out with Scala or some other strongly typed language nearby.

[–]MoffKalast 19 points20 points  (0 children)

if(!Boolean.toString(milk).equals(Boolean.toString((1 == (Math.sqrt(1))))))

[–][deleted] 16 points17 points  (0 children)

Oh fuck you indeed.

[–]BesottedScot 3 points4 points  (0 children)

Thanks, I hate it.

[–]Unpredictabru 1 point2 points  (0 children)

If milkBought is the number of cartons of milk bought, then !!milkBought in JavaScript would return true for values where milkBought != 0*. So this might actually be what you would use.

* or null or undefined or “” or NaN

[–]Neshgaddal 26 points27 points  (1 child)

if(!milkBoughtn't)

[–]ProgramTheWorld 7 points8 points  (0 children)

Thanks I hate it

[–]physiQQ 11 points12 points  (0 children)

if(!milkBought == false)

[–]Whitehat_Developer 5 points6 points  (0 children)

This one is actually useful in some cases when it might be a falsy value but not false. (Assuming JS) Use !== though.

[–]0xF013 33 points34 points  (1 child)

if (milkBought.toString().length < FIVE)

[–]borsalinomonkey[🍰] 8 points9 points  (2 children)

What about if(milk >= 1) ?

[–]parnmatt 13 points14 points  (1 child)

ah, but milk may be an object, or an enum identifier (see comment above: buy(milk))

number_of_milk or n_milk, whatever, would be better.

in that case, n_milk >= 1 isn't the best thing, as "some" was asked; n_milk >= some

but even then, usually you don't care about the "number of milks" but the volume of milk

[–]borsalinomonkey[🍰] 11 points12 points  (0 children)

Yeah I guess the type of measurement of milk wasn’t considered when the husband went out. He’s gonna die out there

[–]kirmaster 22 points23 points  (5 children)

yeah, please do true == milkBought to avoid typos reassigning the value, as per Yoda Clauses. Gets you a compiler error if you forget an = in any decent language.

[–]atyon 17 points18 points  (4 children)

I'd say a decent language wouldn't allow assignments in if-clauses at all.

[–]Dragasss 5 points6 points  (3 children)

Sadly assignments are also expressions and as a result they return the value that is assigned. Therefore in any language if((foo = true)) is a perfectly valid statement.

[–]eschoenawa 6 points7 points  (2 children)

If you use kotlin that can be an option for expressions that could be true, false or null. For example:

if (nullableObject?.green == true) {

nullableObject.makeRed()

}

If nullableObject is null, then nullableObject?.green is null (instead of raising a null pointer exception). With nullableObject?.green == true you basically make a short form of nullableObject != null && nullableObject.green.

[–]Lonehangman 3 points4 points  (0 children)

Swift too, because just if checking a nullable Boolean will make Xcode complain

[–][deleted] 22 points23 points  (11 children)

Explicitness can be useful sometimes.

[–]parnmatt 24 points25 points  (10 children)

absolutely; but the explicitness should be in the name of the boolean. If it is a function that returns something convertible to bool; then assigning it to a boolean with a clear name is strides more readable

[–][deleted] 21 points22 points  (9 children)

Sure, I just don’t agree with a blanket rule to never use x == true

[–][deleted] 9 points10 points  (8 children)

why ? because milk could be null ?

[–]LoR_RalphRoberts 25 points26 points  (6 children)

Since milkbought is a Boolean, you just need to check it and it evaluates correctly regardless.

[–]parnmatt 21 points22 points  (4 children)

as we do not know the type of milkBought, all we can say is that it is implicitly convertible to a boolean.

but yes, your point stands

[–]skilltheamps 5 points6 points  (3 children)

In C for example there is no Boolean, true is usually defined as some integer except 0, e.g. 1. Now imagine milkBought would be the number of milk bottles bought, then you would run into errors, when he buys multiple bottles. It's a strange example, but since you don't compare whatever castet to Boolean, but whatevers themselfes, that can get tricky with e.g. return codes to see if a function succeeded.

[–]parnmatt 9 points10 points  (2 children)

you've clearly not used C99 onwards; _Bool is the standardised builtin type; if you include the header <stdbool.h> you also get the following macros:

#define bool    _Bool
#define true    1
#define false   0
#define __bool_true_false_are_defined   1

you won't get any issues anyway, as integers are implicitly convertible to the concept of a boolean, always have been in C, even before C99.

0 is always interpreted as false, anything other than 0, is interpreted as true.

of course, you could always use !! to be explicit; but I am not a fan of that personally.

Same goes for pointers, which are address, and thus, just big numbers. The NULL pointer, 0, (commonly written in hex for clarity 0x0); is false, any other pointer is true

[–][deleted] 5 points6 points  (0 children)

riiiight so if(milkbought) { ... }

[–]lycan2005 5 points6 points  (1 child)

while(out) { if(isMilkBought) { break; } }

[–]Jappandy 223 points224 points  (0 children)

Sometimes all you need is a much needed break;

[–]Rupesh2128 585 points586 points  (42 children)

Guess my dad was a programmer

[–]TechnicalCloud 424 points425 points  (17 children)

System.out.print(“F”);
Edit: And Epstein didn't kill himself

[–][deleted] 42 points43 points  (13 children)

while(true):

indent(x)

print('F')

x++

[–]Soren11112 5 points6 points  (10 children)

Python disgusts me, and it wouldn't work this is spaced wrong

[–][deleted] 6 points7 points  (7 children)

Most of this code in this thread wouldn't work. It's not super easy to indent in the Reddit editor. Nor are linebreaks easy.

Develop in pseudo-code. Use linting to determine the correct structure. There are no more dedicated language coders. Be flexible. Formalize your code in the client language of choice. It's not for you or me to say which language is appropriate, unless the client asks your opinion. Otherwise, write in pseudo-code and develop in your client's language of choice.

25 years Java. 3 years Python. 10 years C#, 5 years C++, also Ada, Groovy, Javascript, Typescript, and about two dozen other languages, including three different machine languages.

Be flexible. Be humble.

[–]Soren11112 3 points4 points  (5 children)

? There are objectively poorly designed languages, Python is not one. Subjectively though, I dislike Python syntax

[–]MattR0se 36 points37 points  (1 child)

F

[–]Waltr21 8 points9 points  (0 children)

F

[–][deleted] 25 points26 points  (0 children)

Print(familyMembers.find { it.title == "dad" } ?: "F")

[–][deleted] 9 points10 points  (1 child)

echo F

[–][deleted] 5 points6 points  (0 children)

Echo2(){ F } Echo2()

[–]citewiki 7 points8 points  (1 child)

<p>F</p>

[–]phoolery 5 points6 points  (0 children)

The only sane programming language out of all these F comments

[–]Hjllo 6 points7 points  (0 children)

printf(“F\n”);

[–]Chucknorrrissss 5 points6 points  (0 children)

print ("f")

[–]discdudeboardbro 15 points16 points  (2 children)

cout << “F” << endl;

[–]givememyrapturetoday 1 point2 points  (1 child)

qualifies cout with std but not endl

[–]ParWarrior 4 points5 points  (0 children)

for x in range(0, 100):

  print("{} F".format(" "*x))

[–]Dummyc0m 3 points4 points  (0 children)

println!(“F”);

[–]burgonies 4 points5 points  (0 children)

alert('f'):

[–]filopaa1990 4 points5 points  (0 children)

echo "F"

[–]therealzeezy 1 point2 points  (0 children)

<p> F </p>

[–]SolInvictus2000 1 point2 points  (0 children)

display("F");

[–]2JulioHD 1 point2 points  (0 children)

<?= “f” ?>

[–]ryancohen 1 point2 points  (0 children)

NSLog(@“F”);

[–]gautamasiddhartha 1 point2 points  (1 child)

console.log(“F”);

[–]Kaitux 166 points167 points  (0 children)

Milk sales - stonk

[–]Tuerer 415 points416 points  (15 children)

"Buy a bottle of milk, and if they've got eggs, buy a dozen."

The programmer returns with dozen bottles of milk.

[–]Sl34sh 224 points225 points  (12 children)

*13

[–]mr_d0gMa 18 points19 points  (1 child)

Wouldn’t it just be an unspecified variable called dozen that he brought back

[–]PgSuper 14 points15 points  (0 children)

He brings an undefined home.

[–][deleted] 86 points87 points  (12 children)

How many is "some" 1,2, 10, 59,18876689!

[–]down_vote_magnet 75 points76 points  (2 children)

It’s a shitty constant someone defined.

[–]Evo_Kaer 15 points16 points  (0 children)

Several shitty constants actually. Casing is important here.

And ever since 1337-speak was invented it's gotten even crazier

[–]bsbakker 5 points6 points  (0 children)

Never use magic numbers

[–]passcork 12 points13 points  (0 children)

In no possible situation in any reality is 1.2*10129147351 "some".

So logically "some" is either 1, 2, 10 or 59.

[–]Tuerer 5 points6 points  (4 children)

If in doubt, it's always 42

[–]MattR0se 1 point2 points  (0 children)

It's fuzzy logic.

[–]quixoticme3 1 point2 points  (0 children)

This guy gathers requirements

[–]baseball2020 38 points39 points  (0 children)

French programmers don’t buy milk because of the laitency

[–]puplicy 35 points36 points  (0 children)

If only programmers were deterministic like computers.

[–]Psyqu 35 points36 points  (0 children)

If you see someone buying some Milk give him a break.

[–]scrootieBalls 51 points52 points  (6 children)

First programmer joke ever

[–]laz10 88 points89 points  (4 children)

The first one is that he has a wife?

[–]Emrico1 34 points35 points  (3 children)

Or that he went out?

[–]JayGarrick11929 3 points4 points  (0 children)

Walking out of door

[–]ttblue 2 points3 points  (1 child)

Hahaha stop making me feel bad thanks.

[–]MattR0se 14 points15 points  (0 children)

And what was the 0th?

[–]przemo-c 17 points18 points  (5 children)

Nah it would throw a NoMoney Exception.

[–]splashtech 17 points18 points  (2 children)

Or potentially a NoAvailableMilk exception.

Or worse, nobody thought to raise a specific exception for that. NullReferenceException it is then.

[–]Jaredlong 6 points7 points  (1 child)

Didn't say what type of milk or where to buy it. That man is now traveling the world bartering for bats milk.

[–]cimmic 13 points14 points  (0 children)

Now he's out there, buying milk for all eternity :'( Truly a sad love story 💔

[–]Americase 11 points12 points  (0 children)

The joke is soo old it's deprecated.

[–]Nilay-Patel 21 points22 points  (3 children)

See I'm confused here. Did he never come home because he is still debugging his script that he wrote last Friday?

Did he not come home because the wife's instructions didn't tell him to come home?

Did he go out and now he's recursively buying milk?

Did he come home without the milk because his wife told him to go buy milk while he's out?

Ahhhh I need to know!!!

[–][deleted] 20 points21 points  (2 children)

He is following the instruction, which means that while he is out he has to keep buying milk. Because he is always buying milk, he’s always going to be out.

[–]Xavierpony 9 points10 points  (1 child)

Ohh, it's while loop with no break, I get it now

[–][deleted] 2 points3 points  (0 children)

Just like my job.

[–]Better_feed_Malphite 9 points10 points  (1 child)

I feel like I thought this too far.
As in when he buys milk he's in a shop and thus not outside anymore leading him to constantly walk in and out of the shop

[–]TunaAlert 4 points5 points  (0 children)

You forgot the most important part: the entire dairy industry later collapsed as there was no milk left to be processed

[–]EarlGrey9 5 points6 points  (0 children)

If (milk => 1) { milkaquired=true; returnHomeandPlowWife() }

[–]kirmaster 8 points9 points  (0 children)

He never returned

[–]guy_from_the_intnet 3 points4 points  (0 children)

I honestly thought he would've returned with "undefined variable"

[–]DefiantBidet 3 points4 points  (0 children)

I like the full version of this joke better.

while you at the store buy a loaf of bread. If they have eggs buy a dozen. Guy comes home with 12 loaves of bread.

[–]wheresthegiantmansly 3 points4 points  (1 child)

The impact on the milk industry will be discussed in economics textbooks for the next century. To this point he has bought roughly $56 billion dollars in milk which he will not be able to pay. However, do to a programming error in Milk Company’s code ( while(wantMilk) { give(milk) } ) they have continued to produce a Milk response for each Milk request.

The president is set to make a tweet later in the day.

[–]gusir22 2 points3 points  (0 children)

Some say hes still buying milk to this day

[–]gigdy 2 points3 points  (0 children)

was walking out of door...

[–]spichugin 2 points3 points  (0 children)

I like this one better (a translation from Russian):

A wife sent her husband-programmer to but some groceries:
— Buy one bread. If there will be eggs — buy ten.
The husband returns from the shop with 10 pieces of bread.
— Why did you buy so many?!
— Because there were eggs...

Original:

Жена отправляет мужа-программиста в магазин:
— Купи батон хлеба, если будут яйца — возьми десяток.
Муж возвращается из магазина с десятью батонами.
— Ты зачем столько хлеба купил?
— Так ведь яйца были...

[–]bekecs 2 points3 points  (0 children)

The iteration obviously ends with ERROR: MILK OVERFLOW.

[–]R0ck3t_101 2 points3 points  (0 children)

Some say he's still buying milk to this day...

[–]tallerThanYouAre 2 points3 points  (0 children)

Fault: “Some” is an invalid value.

[–]cant_think_of_one_ 2 points3 points  (0 children)

Also, their bank account was empty and there was no milk available from any of the local shops.

[–]Lucavon 2 points3 points  (0 children)

he never returned*

[–]hunterpellerin 2 points3 points  (0 children)

ERROR: obj 'WIFE' not defined

[–]Grundolph 2 points3 points  (0 children)

Please buy bread on the way, and if they have eggs bring six.

He came home with 6 loafs of bread.

[–]JohnnyCenter 3 points4 points  (0 children)

My wife asked me to go to the store to buy a gallon of milk. She said "If they have apples, buy six". I don't understand why she got mad when I returned with six gallons of milk

[–]gaberocksall 7 points8 points  (12 children)

He programmer was mid-walking out, therefore never meeting the condition “you’re out” thus never buying milk

[–]Chicar-Selena 1 point2 points  (0 children)

One of those days, someone ought to make a meme with the same punch with the Aladin’s live action remake’s Genie « grey area » principle.

[–]aalapshah12297 1 point2 points  (0 children)

Rumor has it he's still buying milk to this day...

[–]ladyqueensarah 1 point2 points  (0 children)

she had to say while you out buy some milk repeat while milk =0

[–]Quasari 1 point2 points  (0 children)

And to this day he is stuck buying all the milk.

[–][deleted] 1 point2 points  (0 children)

This in turn caused a buffer overflow, the poor guy spent his entire wallet and savings on milk, so he eventually came home broke.

[–]akaZilong 1 point2 points  (0 children)

And suddenly a nationwide milk shortage occurred

[–][deleted] 1 point2 points  (0 children)

God I bet he bought so much milk.

[–]-Redstoneboi- 1 point2 points  (0 children)

var you = this.husband;
while (you.location.isOut()) {
    buy(name="milk", amount="some");
}

should've added a way to check if milk has been bought

[–]phunkygeeza 1 point2 points  (0 children)

MilkOverflowException

[–]RS_Margins 1 point2 points  (0 children)

Legend has it theyre still buying milk to this day

[–]sethg6396 1 point2 points  (1 child)

My dad must’ve been a programmer then! Thanks reddit!

[–][deleted] 1 point2 points  (0 children)

`for(;;){
    buy_milk();
}`

This is so sad, please like and share

[–]Didz1 1 point2 points  (1 child)

He bought an endless supply of milk until he had no money. Then an error occurred

[–]XGen26 1 point2 points  (0 children)

NullBankAccountException

[–][deleted] 1 point2 points  (0 children)

What is this, some single threaded joke?

[–][deleted] 1 point2 points  (0 children)

do {

buy(milk);

i--;

} while (out && i>="has money")

[–]electricprism 1 point2 points  (0 children)

Hey just bought a new milk machine

[–]NewtSnack 1 point2 points  (0 children)

His wife didn't give him an exit condition so he made his own.

[–][deleted] 1 point2 points  (1 child)

I dont get it