3 ms·
Agreed with a sibling that this is somewhat abusing the terminology. In/pre/postfix of the operators is a different thing from how many terms an operator acts
by taeric 2y ago
Agreed with a sibling that this is somewhat abusing the terminology. In/pre/postfix of the operators is a different thing from how many terms an operator acts on. Indeed, in RPN, it was not uncommon to try and execute an operator but not have enough terms on the stack.
Seems that we typically call the ?: combination a ternary operator largely stems from the distinction between operators, functions, and keywords. One that we largely don't keep in a consistent fashion. Add in functions versus methods, and things get really fun.
Programming also has the odd case where functions have an easy syntax to say that there are multiple inputs, but we don't have a common syntax to say there are multiple outputs. Which is something that is quite common in every domain.
- reichstein 2y agoI'm personally convinced that the reason the conditional operator of called "the ternary operator" it's that the ANSI C Programming Language book contains the phrase "the ternary operator, ?:", and a lot of readers didn't know what "ternary" meant and thought it was a name.
- taeric 2y agoThis sounds reasonable to me. I used to think you could guess what someone's first programming language was based on if they wrote methods or procedures. :D