JPDev@programming.dev to Programmer Humor@programming.dev · 1 年前ifn'tprogramming.devimagemessage-square106fedilinkarrow-up1631arrow-down111
arrow-up1620arrow-down1imageifn'tprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 1 年前message-square106fedilink
minus-squareTrailblazing Braille Taser@lemmy.dbzer0.comlinkfedilinkarrow-up161arrow-down1·1 年前I propose a new, more threatening kind of control flow. do { /* something */ } or else { /* you don't want to find out */ }
minus-squaregex@lemmy.worldlinkfedilinkarrow-up43·1 年前Some C++ style guides suggest the following naming convention for functions that crash on any error OpenFileOrDie()
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up21·1 年前PHP has the always wonderful (and perfectly functional) syntax of logUserIn() or die();
minus-squareKissaki@programming.devlinkfedilinkEnglisharrow-up6·1 年前Personally, I like to call catched exception variables up, so for a rethrow I can throw up;.
minus-squareTwilightKiddy@programming.devlinkfedilinkarrow-up1·1 年前Except rethrowing an exception in C# is just throw;, anything else is a crime against the person who reads your stacktraces.
minus-squareOpenStars@startrek.websitelinkfedilinkEnglisharrow-up4·1 年前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)
minus-squareVorthas@programming.devlinkfedilinkarrow-up3·1 年前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.
minus-squareMesa@programming.devlinkfedilinkarrow-up8·1 年前The better try-catch. More intuitive if you ask me.
minus-squarejadelord@discuss.tchncs.delinkfedilinkarrow-up5·1 年前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.
minus-squareOpenStars@startrek.websitelinkfedilinkEnglisharrow-up5arrow-down1·1 年前You just made me a offer I can’t refuse. I go now to sleep with the fishes…
minus-squarerothaine@beehaw.orglinkfedilinkEnglisharrow-up4·1 年前do { /* something */ } do hast { /* something */ }
minus-squareTrailblazing Braille Taser@lemmy.dbzer0.comlinkfedilinkarrow-up6·1 年前do { /* something */ } do hast { /* something */ } do hast mich { /* something */ }
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()
PHP has the always wonderful (and perfectly functional) syntax of
logUserIn() or die();
Or Perl
Where do you think PHP stole it from?
Bash?
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.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)
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.Now what about GZDoom’s
GoAwayAndDie();
?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.
You just made me a offer I can’t refuse. I go now to sleep with the fishes…
do { /* something */ } do hast { /* something */ }
do { /* something */ } do hast { /* something */ } do hast mich { /* something */ }