4 ms·
Custom operators make code more readable when used appropriately; and any aspiring general purpose language that refuses to support them is cutting off the nose
by willtim 8y ago
Custom operators make code more readable when used appropriately; and any aspiring general purpose language that refuses to support them is cutting off the nose to spite the face.
- zaphar 8y agoAny language with a large userbase has a large group of people who don't use them appropriately. The result is a majority of code that is unreadable. Any language that depends on people to just "don't do that" is a language that will be full of people who do exactly that.
- willtim 8y agoThis is a social problem, it can be solved without such a blunt instrument. Single letter variable names also make code more readable, but only when used appropriately. Your argument would suggest banning those! IMHO it is better to concentrate on getting the semantics right and not waste any goodwill on restricting syntax.
- zaphar 8y agoYes it is a social problem. But I disagree that you can solve the social problem without very opinionated and restrictive syntax and semantics.
- willtim 8y agoI respect your position, which was shared by the designers of Java and Go, but any language I choose to use is one that seeks to empower me. For example, the purity restriction in Haskell exists to ultimately empower me, not because the language designers have contempt for my abilities.
- zaphar 8y agoI also respect yours. This is why there are multiple options in the PL arena for people to choose.
- vmchale 8y ago> Any language that depends on people to just "don't do that" is a language that will be full of people who do exactly that. If you make a language for stupid people, that is fine, but I will not use it.
- Bizarro 8y agoAny language with a large userbase has a large group of people who don't use them appropriately. Nope. That was what the Java people were saying a decade and a half ago about C# having operator overloading and it just didn't turn out to be apocalyptic madness with nonsense operator overloading all over the place....just didn't happen. On the Java side we have the BigInteger, BigDecimal mess - https://www.baeldung.com/java-bigdecimal-biginteger https://www.baeldung.com/java-bigdecimal-biginteger