3 ms·
> You can argue all you want about how order-of-operations makes things unnecessarily complicated That's not what I'm arguing. It's okay for that complexity to
by jd 17y ago
> You can argue all you want about how order-of-operations makes things unnecessarily complicated
That's not what I'm arguing. It's okay for that complexity to exist, I just don't think that exposing it to the end programmer is by definition a good thing. If you have a fixed set of infix operators then you can have a well defined grammar. If you have an extensible set of infix operators, then you need to make major changes to your grammar to prevent ambiguity.
The way infix operators work is a decision the language designer has to make early on. Bolting on a way to create new infix operators in Java (not that you're suggesting that) would be a disaster. I agree with you that sacrificing the "just work" aspect in the name of strong typing (OCaml) or in the name of uniformity (Lisp) is a bad trade-off.
- silentbicycle 17y agoI agree with you -- I wasn't refuting your point, but rather noting that it's worth considering as a major usability issue for the language, rather than strictly a technical decision. (I meant to say, "One can argue ...", but hadn't had my tea yet. I can see why you read it that way.) I had Hexstream's glib "The solution is to use prefix notation. Problem solved!" reply in mind, actually: in that case, the language trades a syntactic ambiguity for pissing off everyone who expects to do basic arithmetic without major problems, which will disproportionately be people new to the language. Cavalierly dismissing this is hardly a solution. If I were new to Lisp, and trying to use it for something based on relatively simple arithmetic (say, totaling a categorized spending log), and a question about why "total + val" didn't work was answered with a digression about parsing, I would be pretty annoyed. If the person talking up Lisp were to then go into a spiel about how Lisp is great because you can extend the language to express things in their own terms when I couldn't even use arithmetic, I would probably assume they were full of it and write off Lisp entirely.