3 ms·
I suspect overhauling the syntax is the kind of change that the committee would see as rather dramatic and with limited payoff. Introducing an optional alternat
by MaxBarraclough 6y ago
I suspect overhauling the syntax is the kind of change that the committee would see as rather dramatic and with limited payoff. Introducing an optional alternative syntax alongside the existing one, would likely be seen as opening the door to syntactic inconsistencies, more likely to harm readability than to enhance it. The Python community has a relevant saying: There should be one -- and preferably only one -- obvious way to do it. [0]
I don't think it's a serious problem that Ada uses and then rather than &&, and uses or else rather than ||. It's the kind of thing you can get used to with time.
[0] https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/
- Lucretia9 6y agoand then and or then are shortcut operations, not the same as && and ||, those are and and or.
- MaxBarraclough 6y agoIn C and C++, the && and || operators both short-circuit. For eager semantics in C/C++ you could make do with the bitwise operators & and |, keeping in mind that they're bitwise and not logical. You could do something like (!!first_int) | (!!second_int). You'd be better off forcing eager evaluation by saving the results to local variables, and then use the short-circuit logical operators. Ada's and and or operators have no direct equivalents in C or C++. https://en.wikipedia.org/wiki/Short-circuit_evaluation#Support_in_common_programming_and_scripting_languages https://en.wikipedia.org/wiki/Short-circuit_evaluation#Suppo...