assert 'P' != 'NP' # proof is left as an excercise for the reader
# Worst-case scenario we can only catch errors at a granularity
# of the whole function.
# If we have access to the source, we can silence errors on a
# per-expression basis, which is "better".
def __exit__(self, exc_type, exc_value, traceback):
# Returning True prevents the error from propagating. Don't silence
# KeyboardInterrupt or SystemExit. We aren't monsters.
It was funny! There was a religious or medieval theme or something. I can never find it...
How could anyone not love this tool?
(Previous discussion: https://news.ycombinator.com/item?id=9396116 )
Also, it's from Smalltalk, and found in some ways also in python, objective-c and many others.
So if you want the same thing but for JS give the above a shot.
That said, I have met some developers who would find this as an advantage and might actually try to put it into use. Generally these are folks who prefer the default soldier-on-in-the-face-of-errors behavior from sh and perl.
Nobody in the Perl world prefers that, outside of people who are complete newbies. In fact, collectively Perl has been yelling at newbies for decades that anything not containing `use strict;` and `use warnings;` is almost without fail broken code, mainly because there are a lot of very old and outdated tutorials which introduce these modules as optional and/or way too late.
I think these are actually old-bies. They don't opt-in to `use strict;` because they like it that way. I suppose they just have an astonishingly high pain threshold.
That said, i've never met these people outside of said companies and especially not on the internet and most decidedly not anywhere near any sort of perl community. They've all been strict 9-5ers for whom the coding is a burden to bear to pay the bills and nothing else.
The people who're old and in the community? They're on the same Kwalitee train as everyone else.
DFSG compatible Yes
FSF approved Yes
OSI approved No
GPL compatible Yes
Linking from code with a different license Yes
You and I have different definitions.