4 ms·
programmers a choosing a language because of syntax are like house buyers choosing a house because of the color it's painted
by kragen 3y ago
programmers a choosing a language because of syntax are like house buyers choosing a house because of the color it's painted
- lex-lightning 3y agoBut what if the two houses are otherwise identical? Even a small convenience will tip decisionmaking
- kragen 3y agoin cases similar to that, it would be a reasonable thing to do
- tmtvl 3y agoI'd like to think I'd have a far easier time painting a mauve house ochre than I'd have trying to change Rust to have an S-expression syntax (not in the least because I have the programming chops of a slightly dimwitted housefly).
- kragen 3y agoit's an excellent point: non-programmers choosing a programming language would do well to pick a language whose syntax they like, since they can't change it
- erik_seaberg 3y agoThe wrong paint won’t stop you from adding a garage, but choosing a complex and non-uniform syntax makes it so hard for end users to extend the language that we almost never try. Imagine how much more readable Java would be if Lombok didn’t need to smuggle each option in a prefix @Annotation.
- kragen 3y agoif running your java through m4 before you compiled it is a major advantage, doing it is trivial. compiling from a completely different surface syntax is a little more work but still not life-changing
- erik_seaberg 3y agoThe hard part is parsing Java’s grammar with your extensions, and then validly altering a complex AST with many different types of statements and declarations. That’s the only way to make your work read like Java, and why Lombok doesn’t.
- samatman 3y agoI seem to recall some fellow or other describing notation as a tool of thought. That doesn't sound superficial to me.
- kragen 3y agothat was iverson, explaining the motivation for apl. you may have noticed that apl-like notations have not supplanted algol-like notations like c, python, golang, lua, and scheme for programming in the way that arabic numerals have supplanted roman numerals and algebraic formulas have supplanted geometric diagrams and natural-language arguments. the apl data model is very popular in some application areas (numpy, r, and tensorflow are based on it) but the notation is not. today apl, j, and k are less popular than haskell to me, this indicates that iverson was mistaken: apl users did not gain major cognitive advantages over users of programming languages with more conventional syntax, so language choice has been driven by other factors. the same cannot be said about programming language choice in general; writing things in assembly language clearly takes much longer than writing them in c, python, golang, lua, scheme, or basic. but that turns out to be a result of their different data models, not different syntax