Personally, I like to call catched exception variables up
, so for a rethrow I can throw up;
.
Comment on ifn't
gex@lemmy.world 9 months agoSome C++ style guides suggest the following naming convention for functions that crash on any error
OpenFileOrDie()
Kissaki@programming.dev 9 months ago
OpenStars@startrek.website 9 months ago
It’s funnier when you try to SysCallAndDie() :-P
(that’s a real thing in perl btw - I guess that function didn’t get the memo)
Vorthas@programming.dev 9 months ago
One of the modules in a project I’m working on is called
VulkanOrDie
which always makes me crack up when I see it in the compilation messages.MonkderZweite@feddit.ch 9 months ago
I mean, it makes sense to call ComplainToErrorAndExit just ‘die’, no?
xmunk@sh.itjust.works 9 months ago
PHP has the always wonderful (and perfectly functional) syntax of
logUserIn() or die();
msage@programming.dev 9 months ago
Or Perl
frezik@midwest.social 9 months ago
Perl also has
unless()
for the very purpose in OP, which is a more sensible choice.evatronic@lemm.ee 9 months ago
Where do you think PHP stole it from?
msage@programming.dev 9 months ago
Bash?