Skip to content

Instantly share code, notes, and snippets.

@krakjoe

krakjoe/rfc.md Secret

Created August 31, 2015 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krakjoe/c73dbf222a918e34e4ba to your computer and use it in GitHub Desktop.
Save krakjoe/c73dbf222a918e34e4ba to your computer and use it in GitHub Desktop.
The Shrug Operator

Proposal: exceptions are annoying, we need a way to ignore them. I propose the shrug (whatever) operator:

¯\_(ツ)_/¯

It work would look this:

try {
	thing_that_throws_exception() or ¯\_(ツ)_/¯;
} catch (NastyPointlessException $npe) {
	# control never enters this block

}

It doesn't matter how it should work, or whether it's a good idea, we need it, because exceptions are annoying.

@vlakarados
Copy link

We should differentiate the new shruggable exceptions by throwing them via the new (╯°□°)╯︵($e)

@elipoultorak
Copy link

Any update on the release timeline?
Also, what about using U+1F937 instead? https://emojipedia.org/shrug/#emoji-copy

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