3 ms·
Another approach taken in some programming languages is to dispense with operators entirely and just use functions, with fairly loose restrictions on function n
by nradov 9y ago
Another approach taken in some programming languages is to dispense with operators entirely and just use functions, with fairly loose restrictions on function names. For example, in principle there's no reason a function couldn't be named "+" or "|". Obviously that can lead to readability problems.
- Jach 9y agoAnd then in some of those languages they let you create macros so in the cases where the normal function syntax looks ugly you can make it readable with no cost... But with macros comes the same sort of potential abuse as other operator overloading, so it's a tradeoff.