3 ms·
It seems obvious that bad syntax harms readability, in that it's very easy to construct an example of a programming language that is truly unreadable (use comma
by MrJohz 4y ago
It seems obvious that bad syntax harms readability, in that it's very easy to construct an example of a programming language that is truly unreadable (use commas to indicate generics, everything must be upper case, backslash to call functions and pipe to separate arguments, the letter `H` is used to start a class declaration, etc - the Intercal of syntaxes).
But the reverse seems more difficult to argue: that there is some ideal syntax that is objectively more reasonable than all other syntaxes. I have preferences (do/end blocks feel like unnecessary noise, I like my types to be written inline in my functions, angle brackets feel right for generics), and some of them even have a veneer of logic behind them (significant indentation is a nuisance when I want to paste a block of code that has the wrong indentation). But clearly other people have different preferences, because they keep on designing languages that don't fit my ideal aesthetics.
The other side of this is that the more I write different languages, the less important syntax becomes. The places where I appreciate the syntax of a particular language are usually because the syntax fits particularly well with the language's semantics, rather than because the syntax itself is good or bad. Partial application in ML-family languages is syntactically very neat, but I don't feel the need to remove parentheses from Javascript because of it. What I really like is partial application, and using space as the function application operator works well with those semantics.
- stephc_int13 4y agoI think that many recent or a bit less recent languages uses too many symbols instead of words. Words are less ambiguous and cleaner.
- MrJohz 4y agoI mean, sure. I disagree, but I can see what you mean. But that's not an argument for one being better than the other, it's an argument of preference. You happen to like words over symbols. In my experience, when I actually start getting to grips with a new language, the syntax very quickly becomes one of the least interesting things about it.
- rascul 4y ago> it's very easy to construct an example of a programming language that is truly unreadable I submit for your consideration Brainfuck and Whitespace. There are others but these two came to mind first. https://en.wikipedia.org/wiki/Brainfuck https://en.wikipedia.org/wiki/Brainfuck https://en.wikipedia.org/wiki/Whitespace_(programming_language) https://en.wikipedia.org/wiki/Whitespace_(programming_langua...