Skip to content

Instantly share code, notes, and snippets.

@josteink
Last active October 21, 2020 05:37
Show Gist options
  • Star 63 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save josteink/cade68b98499fa518b81 to your computer and use it in GitHub Desktop.
Save josteink/cade68b98499fa518b81 to your computer and use it in GitHub Desktop.
On why stateful code is bad
On why stateful code is bad
===========================
STUDENT: Sir, can I ask a question?
TEACHER: Yes!
STUDENT: How do you put an elephant inside a fridge?
TEACHER: I don't know.
STUDENT: It's easy, you just open the fridge and put it in. I have another question!
TEACHER: Ok, ask.
STUDENT: How to put a donkey inside the fridge?
TEACHER: It's easy, you just open the fridge and put it in.
STUDENT: No sir, You just open the fridge take out the elephant and put it in.
TEACHER: Ooh...ok!!
STUDENT: Let me ask another one. If all the animals went to the lion's birthday party, and one animal went missing which one would it be?
TEACHER: The lion of course! Because it would eat all the animals.
STUDENT: No sir, it is the donkey, because it's still inside the fridge.
TEACHER: Are you kidding me?
STUDENT: No sir, 1 last question.
TEACHER: Ok!
STUDENT: If there's a river known to be full of crocodiles and you wanted to cross, how would you?
TEACHER: There's no way, I would need a boat to cross.
STUDENT: No sir, you just swim and cross it because all the animals went to the lion's birthday party.
@darthtrevino
Copy link

When the gist is copied as a slack link, there's no title that gives this joke context. Consider adding "Why Stateful Code is Bad" as a title line at the beginning.

@zookatron
Copy link

Very reminiscent of The Codeless Code. Good stuff.

@josteink
Copy link
Author

josteink commented Mar 8, 2016

@darthtrevino Is that better? I don't have a slack server/account to test with, so I can't really tell.

@nsh87
Copy link

nsh87 commented Mar 13, 2016

@josteink, ya that works fine in slack

@the-dr-lazy
Copy link

React's codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment