JPDev@programming.dev to Programmer Humor@programming.dev · 6 months agoifn'tprogramming.devimagemessage-square108fedilinkarrow-up1694
arrow-up1684imageifn'tprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 6 months agomessage-square108fedilink
minus-squareTrailblazing Braille Taser@lemmy.dbzer0.comlinkfedilinkarrow-up192arrow-down1·6 months agoI propose a new, more threatening kind of control flow. do { /* something */ } or else { /* you don't want to find out */ }
minus-squaregex@lemmy.worldlinkfedilinkarrow-up55·6 months agoSome C++ style guides suggest the following naming convention for functions that crash on any error OpenFileOrDie()
minus-squareKissaki@programming.devlinkfedilinkEnglisharrow-up10·6 months agoPersonally, I like to call catched exception variables up, so for a rethrow I can throw up;.
minus-squareTwilightKiddy@programming.devlinkfedilinkarrow-up2·5 months agoExcept rethrowing an exception in C# is just throw;, anything else is a crime against the person who reads your stacktraces.
minus-squareMonkderZweite@feddit.chlinkfedilinkarrow-up4·6 months agoI mean, it makes sense to call ComplainToErrorAndExit just ‘die’, no?
minus-squareVorthas@programming.devlinkfedilinkarrow-up4·6 months agoOne 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.
minus-squareOpenStars@startrek.websitelinkfedilinkEnglisharrow-up4arrow-down1·6 months agoIt’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)
minus-squareyum13241@lemm.eelinkfedilinkarrow-up1·6 months agoNow what about GZDoom’s GoAwayAndDie();?
minus-squareStrawberry@lemmy.blahaj.zonelinkfedilinkarrow-up40·6 months agothis is just a menacing try/catch!
minus-squareMesa@programming.devlinkfedilinkarrow-up8·6 months agoThe better try-catch. More intuitive if you ask me.
minus-squarejadelord@discuss.tchncs.delinkfedilinkarrow-up7·6 months agoIt exists, kind of. Python has this construct for item in iterable: ... else: ... which always puzzles me, since it depends on a break statement execution. I always have to look it up when the else block is executed.
minus-squarerothaine@beehaw.orglinkfedilinkEnglisharrow-up5·6 months agodo { /* something */ } do hast { /* something */ }
minus-squareTrailblazing Braille Taser@lemmy.dbzer0.comlinkfedilinkarrow-up7·6 months agodo { /* something */ } do hast { /* something */ } do hast mich { /* something */ }
minus-squareOpenStars@startrek.websitelinkfedilinkEnglisharrow-up6arrow-down2·6 months agoYou just made me a offer I can’t refuse. I go now to sleep with the fishes…
I propose a new, more threatening kind of control flow.
do { /* something */ } or else { /* you don't want to find out */ }
Some C++ style guides suggest the following naming convention for functions that crash on any error
OpenFileOrDie()
Personally, I like to call catched exception variables
up
, so for a rethrow I canthrow up;
.Except rethrowing an exception in C# is just
throw;
, anything else is a crime against the person who reads your stacktraces.I mean, it makes sense to call ComplainToErrorAndExit just ‘die’, no?
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.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)
Now what about GZDoom’s
GoAwayAndDie();
?this is just a menacing try/catch!
It_would_be_a_shame_if(condition)
The better try-catch. More intuitive if you ask me.
It exists, kind of. Python has this construct
for item in iterable: ... else: ...
which always puzzles me, since it depends on a break statement execution. I always have to look it up when the else block is executed.
do { /* something */ } do hast { /* something */ }
do { /* something */ } do hast { /* something */ } do hast mich { /* something */ }
You just made me a offer I can’t refuse. I go now to sleep with the fishes…