Trailblazing Braille Taser ( @0x0@lemmy.dbzer0.com ) 124•6 months agoI propose a new, more threatening kind of control flow.
do { /* something */ } or else { /* you don't want to find out */ }
Strawberry ( @Strawberry@lemmy.blahaj.zone ) 28•6 months agothis is just a menacing try/catch!
moody ( @moody@lemmings.world ) 13•5 months agoIt_would_be_a_shame_if(condition)
Mesa ( @Mesa@programming.dev ) 5•5 months agoThe better try-catch. More intuitive if you ask me.
OpenStars ( @OpenStars@startrek.website ) English5•5 months agoYou just made me a offer I can’t refuse. I go now to sleep with the fishes…
jadelord ( @jadelord@discuss.tchncs.de ) 5•5 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.
rothaine ( @rothaine@beehaw.org ) English4•5 months agodo { /* something */ } do hast { /* something */ }
Trailblazing Braille Taser ( @0x0@lemmy.dbzer0.com ) 6•5 months agodo { /* something */ } do hast { /* something */ } do hast mich { /* something */ }
OpenStars ( @OpenStars@startrek.website ) English65•6 months agoPlease God let this be a humorous post that somehow does not also find a way to manage to come true…
jtk ( @jtk@lemmy.sdf.org ) English49•6 months agoI would have bought it if they said ifnot instead, it’s the same number of characters and wouldn’t require a major parser overhaul to support keywords with a ’ in the name.
Pup Biru ( @pupbiru@aussie.zone ) 26•6 months agoi mean, “unless” tends to be the usual term for an “if not” keyword in languages that implement such a thing
Fal ( @Fal@yiffit.net ) English15•6 months agoWhich is awful and incredibly confusing. I hate ruby
Pup Biru ( @pupbiru@aussie.zone ) 3•5 months agototally agree; just saying that if it’s GOT to be something, that something should probably be unless… unless . . .
msage ( @msage@programming.dev ) 3•5 months agoAnd Perl
NigelFrobisher ( @NigelFrobisher@aussie.zone ) 3•5 months agoAnd my axe!
frezik ( @frezik@midwest.social ) 2•5 months agoI find that you need to choose carefully when to use it. Simple cases tend to be alright. Larger, more complex conditions shouldn’t touch it.
OpenStars ( @OpenStars@startrek.website ) English12•6 months agoYeah, to be clear, I don’t like it, I don’t like it one bit:-P.
MagicShel ( @MagicShel@programming.dev ) 48•6 months agoReduce exclamation marks!? Great Scott!!! Is there a shortage of punctuation in the future!?
KairuByte ( @KairuByte@lemmy.dbzer0.com ) 13•6 months agoYou could have saved two, all you had to do was use the interrobang. You’re a monster.
SubArcticTundra ( @SubArcticTundra@lemmy.ml ) 9•6 months agoAll known deposits were depleted
janabuggs ( @janabuggs@beehaw.org ) 30•5 months agoI’m struggling to understand if this is true or ifn’t true
taanegl ( @taanegl@beehaw.org ) 24•6 months agoI’m just hoping this paves the way to code with Southern dialect
iffun is == true iffun ain't == false
timetravel ( @timetravel@lemmings.world ) 21•5 months agoMay I introduce you to the joys of #define and creating your own horrible sub language
frezik ( @frezik@midwest.social ) 6•5 months agoThat reminds me of an old paper about how to create a compilable C program out of old game ROMs. Decompile to assembly. Implement a bunch of
#define
statements that implement all the ASM statements. Now compile it to a native binary on whatever platform.Won’t likely be faster or more accurate than regular emulation methods, but it’s a neat idea considering that the source code on all this stuff was lost a long time ago.
xia ( @xia@lemmy.sdf.org ) English20•6 months ago“Help’s with readability”? You know what else helps? Not using contractions and introducing an unbalanced single quote.
bdonvr ( @bdonvr@thelemmy.club ) 25•6 months agoIf they’d’nt’ve done that, it’d’ve been better. Agreed.
Cwilliams ( @Cwilliams@beehaw.org ) 3•5 months agoAside: rip Tom Scott
survivalmachine ( @survivalmachine@beehaw.org ) 3•6 months agoThis feels racist against Appalachia. We naturally speak with contractions and are commonly referred to as “unbalanced”.
frezik ( @frezik@midwest.social ) 3•5 months agoRuns havoc on parsing, too. It’s bad for both humans and robots. I say we ship it.
rimjob_rainer ( @rimjob_rainer@discuss.tchncs.de ) 20•5 months agoWhy not just ifnot? Same count of characters but an o instead of a possibly problematic single quote.
Ferk ( @Ferk@kbin.social ) 12•5 months agoYes… how is “reducing exclamation marks” a good thing when you do it by adding a
'
(not to be confused with,
´,
‘or
’` …which are all different characters).Does this rely on the assumption that everyone uses a US QWERTY keyboard where
!
happens to be slightly more inconvenient than typing'
?
jtk ( @jtk@lemmy.sdf.org ) English11•6 months agoifn't (myNum don't= 3 && myStr ain'tnull'rblankish)
SubArcticTundra ( @SubArcticTundra@lemmy.ml ) 5•6 months agoI hate seeing colloquial terms like ‘ain’t’ in non-comment (ie. standardized) parts of code
vlad ( @vlad76@lemmy.sdf.org ) 9•6 months agoWhat’s wrong with “else”
NekkoDroid ( @NekkoDroid@programming.dev ) 30•6 months agoIt’s not
ifn't
Darkassassin07 ( @Darkassassin07@lemmy.ca ) English3•6 months agoif(condition) {#block never used} else {#actually do a thing}
Vs
ifn't(condition) {#actually do a thing}
Vs
if!(condition) {#actually do a thing}
gandalf_der_12te ( @gandalf_der_12te@feddit.de ) 2•6 months agovs
if (not condition) {#actually do a thing}
MNByChoice ( @MNByChoice@midwest.social ) 2•6 months agoCannot start a statement with else. One can with ifn’t. There is a new thing where we don’t branch (which is a separate discussion).
Or am I missing the joke…
tiredofsametab ( @tiredofsametab@kbin.social ) 7•6 months agodie unless $keyword == “unless”;
Dieguito 🦝 ( @DieguiTux8623@feddit.it ) 1•5 months agoI personally have a gut feeling of rejection for every language having the
unless
keyword. This is why I hardly know any PERL and Ruby for example.I have mixed feelings towards Kotlin’s
takeUnless
scope function (I nearly always usetakeIf
with a negated predicate) because my mind forgets the unless version exists.
fl42v ( @fl42v@lemmy.ml ) 6•6 months agoThis has to be illegal. I mean, it’s basically suicide incitement (or whatever is the phrase for it)
luciole ( @luciole@beehaw.org ) 4•6 months agoI shan’t!
max ( @max@lemmy.blahaj.zone ) 2•6 months ago;-;
lordmauve ( @lordmauve@programming.dev ) 2•5 months agoPython already has this.