When I was a beginner it took a while to learn the language syntax and the idea that languages couldn't improve after they were invented.
But now we're seeing new language features added every year with ES5, ES6 the so on.
If I don't write software for a few weeks or months when I come back to it I have often found for the first few days found myself writing if statements with the literal words and
and or
.
if (isSinglePost and isLoggedIn) {
// do something
}
AND I've seen other languages use literal and
and literal or
in their language syntax.
I'd like to have the option to use and
and or
or ||
and &&
. I'm not saying it's the best practice but it would be nice to have that option for readability and writability.
So now I'm wondering is there any reason languages didn't use and
and or
in their language syntax in the first place when they were invented? And would there be any negatives to adding it now?
ES2019candidate
$_
as the topic variable) and replied that "Perl provides word-oriented aliases to all of these variables, if you choose to write COBOL in Perl. Oddly, most folks don't."&&
and||
are usually more like control flow operators like? :
than they are like logical operators. There's nothing special about the way this operator is written in the field of logic.