1
\$\begingroup\$

This question already has an answer here:

I am looking for either suggestions or examples of more famous sayings written in code! If you have a website or database of them, please link that below your favorite one! Examples:

while(!(succeed = try()))


if(lifegivesyou == lemons) {makelemonade();)
\$\endgroup\$

marked as duplicate by Digital Trauma, Hosch250, Howard, Justin, John Dvorak Feb 26 '14 at 6:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \$\begingroup\$ I prefer if(life.gives(you,lemons)) you.throw(lemons,'people you don\'t like') \$\endgroup\$ – Braden Best Mar 4 '14 at 20:07
3
\$\begingroup\$
if (glass.getLevel() == 0.5)
    throw new ContainerTooLargeException(glass + " is twice as big as it needs to be.");
\$\endgroup\$
  • \$\begingroup\$ Wouldn't that be an OptimismException? \$\endgroup\$ – Comintern Feb 26 '14 at 4:43
  • 1
    \$\begingroup\$ The optimist says the glass is half full. The pessimist says it's half empty. The engineer says the glass is twice as big as it needs to be. \$\endgroup\$ – TheDoctor Feb 26 '14 at 15:47
4
\$\begingroup\$

How about:

~wish&~want;

or

Penny.Earned = Penny.Save();
\$\endgroup\$
  • \$\begingroup\$ Nice ones! I wish I could upvote! MOAR PLS \$\endgroup\$ – DrJonesYu Feb 26 '14 at 5:37
  • \$\begingroup\$ Shouldn't this just be Penny saved = earned; \$\endgroup\$ – user21375 May 16 '14 at 20:46
4
\$\begingroup\$

bash

say "It's going to be legen..."
waitforit
say "dary!"
\$\endgroup\$
2
\$\begingroup\$

C++

Toast toast = New Toast();
toast.fillside("butter", "up");
toast.fall(); //this method swaps sides, now buttered side is down
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.