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
Perl also has
unless()
for the very purpose in OP, which is a more sensible choice.Oh, and if you need to reinforce your belief that Perl is a mess, the single-quote character can be used as a package separator instead of “::”. This was set in the 90s when nobody was quite sure of the right syntax for package separators, so it borrowed “::” from C++ and the single quote from Ada (I think).
That means the
ifn't()
in OP can be interpreted as calling thet()
function on theifn
package.The “::” separator is vastly preferred, though. Single quotes run havoc on syntax highlighting text editors (since they can also be used for strings). About the only time I’ve seen it used is a joke module,
Acme::don't
.
I mean, it makes sense to call ComplainToErrorAndExit just ‘die’, no?
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)
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.
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…
This can’t be for real. I’ll stick with C11 thank you.
Here you dropped this:
#define ifnt(x) if (!(x))
cap () {
}
nocap () {}
nocap(frfr){
}
Reduce exclamation marks!? Great Scott!!! Is there a shortage of punctuation in the future!?
You could have saved two, all you had to do was use the interrobang. You’re a monster.
1.21GB!!!
Kernighan, what was I thinking?
All known deposits were depleted
ifn't(!valid)
halp?I believe that resolves the same as
ain’t!(!untrue)
Removed by mod
deleted by creator
unlessn’t
I’m sorry, I hate the “unless” so much
At one of my first jobs, I was tasked to rewrite a bunch of legacy Perl scripts in Python and the unless lines always made me trip up. I don’t know why but it really messed with my mental flow when reading Perl code
I’m just hoping this paves the way to code with Southern dialect
iffun is == true iffun ain't == false
May I introduce you to the joys of #define and creating your own horrible sub language
That 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
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.
aint (something) { somethingElse() }
Please God let this be a humorous post that somehow does not also find a way to manage to come true…
I 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.
Yeah, to be clear, I don’t like it, I don’t like it one bit:-P.
If not anybody have time for that.
*ifn’t*
Oh dear Lord what have I done!? :-P
i mean, “unless” tends to be the usual term for an “if not” keyword in languages that implement such a thing
Which is awful and incredibly confusing. I hate ruby
And Perl
And my axe!
I’d take a
not
or “if not” operator tbh.What’s wrong with “else”
It’s not
ifn't
^This
OP raises a valid point