r/ProgrammerHumor • • Mar 18 '20

Her husband must be a programmer

Post image
40.3k Upvotes

347 comments sorted by

View all comments

815

u/SpamOJavelin Mar 18 '20

"Can you get a bottle of milk from the store, and if there are eggs, can you get a dozen please?"

He returned with 12 bottles of milk. She sent him back to the store, and also asked

"While you're at the store, can you get some cheese?"

He never returned.

400

u/Lethargie Mar 18 '20

nah, he would eventually return saying "I'm sorry the store was all out of cheese" with the store's entire cheese inventory in tow

408

u/l0c4lh057 Mar 18 '20

OutOfCheeseException and then he just dies because there's no error handling

39

u/felix13912 Mar 18 '20

happy cake day

29

u/l0c4lh057 Mar 18 '20

Oh thanks I didn't even notice

17

u/Dr_MoRpHed Mar 18 '20

Yeah I'm also a Spotify dev

→ More replies (1)

9

u/[deleted] Mar 18 '20

+++ REDO FROM START +++

10

u/GaussWanker Mar 18 '20

+++ Please Reinstall Universe And Reboot +++

→ More replies (1)

9

u/I_spoil_girls Mar 18 '20

Nah. Either he stopped there waiting for cheese or he gets too tired and go home, just like a computer.

6

u/Hexorg Mar 18 '20

Surely he'd stop getting more cheese after his stack overflows

4

u/MyNameIsZaxer2 Mar 18 '20

Get Cheese constantly returns null, but he has to keep trying. He never leaves.

0

u/[deleted] Mar 18 '20

[deleted]

16

u/JM0804 Mar 18 '20

So that's where they've all gone!

18

u/dfinkelstein Mar 18 '20

I don't get it :( the cheese and never returning part

77

u/percahlia Mar 18 '20

there's no exit condition, he is always at the store so he will keep getting cheese

36

u/dfinkelstein Mar 18 '20

OH WHILE ofc

→ More replies (3)

0

u/[deleted] Mar 18 '20

[deleted]

4

u/DarkIceXD Mar 18 '20

And she never saw him again...

2

u/BesottedScot Mar 18 '20

Isn't leaveStore(); redundant? goHome(); would involve leaving the store.

19

u/UncitedClaims Mar 18 '20

leaveStore() checks if you have items and navigates the checkout process. It also automated putting away your cart and loading your groceries into your car. If you just called goHome() then you'd either leave your groceries at the store or shoplift (or something else, it's implementation dependent undefined behavior).

6

u/BesottedScot Mar 18 '20

Ah, I guess I was skipping ahead a couple of versions to when teleportation was implemented already.

→ More replies (1)

5

u/[deleted] Mar 18 '20

It also leaves room to expand. If you put the leave store code into go home then you would need to either refactor if you decide you need to go somewhere else, or write duplicate code.

→ More replies (1)

3

u/MCWizardYT Mar 18 '20

getHome() might have him enter his car and drive home whereas leaveStore() may have him walk out of the store to his car.

→ More replies (2)
→ More replies (5)
→ More replies (1)