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();
Personally, I like to call catched exception variables up
, so for a rethrow I can throw up;
.
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.
i mean, “unless” tends to be the usual term for an “if not” keyword in languages that implement such a thing
cap () {
}
nocap () {
}
Reduce exclamation marks!? Great Scott!!! Is there a shortage of punctuation in the future!?
Basic used “else”.
It’s nice. “if”, “then”, and “else”. I spent a year programming a shitty roulette game on an Apple 2e back in high school. I still remember the joy of using if/then/else paired with goto to make a horrible mess of spaghetti logic.
But yeah, “else” is nice.
Using a standalone ‘else’ would tickle my brain in the same nice way that being able to declare a variable inside an ‘if’ statement as if it were a ‘for’ loop (which you can do in modern C++) does.
Many languages let you scope variables.
In c# you can create an arbitrary scope to declare variables in. Most likely in others as well.
Please God, no. I had to unravel terminal scripting code that was written in some propriety BASIC language with basically no documentation.
Took me a chunk of time trying to figure out how it worked before I made the realization that it was BASIC
I haven’t written any Ruby for years, but I still praise it in every conversation I have regarding programming languages. It’s basically a much simpler Python, with some design ideas that are both beautiful and deeply strange.