5 ms·
It's debatable whether "simple and regular syntax" is a strength or a weakness. Lisp/Scheme might be too regular for their own good. Consider the following stat
by breuleux 11y ago
It's debatable whether "simple and regular syntax" is a strength or a weakness. Lisp/Scheme might be too regular for their own good. Consider the following statements in Scheme, for instance:
(lambda x (+ x x))
(cond (> x 2) (+ x x))
(if (> x 2)
(do-this when-true)
(also-do-this when-true))
They are syntactically correct (technically), but they are probably not what you meant. So you still have to pause and ask yourself how cond works... except the parser will not help you.
That is to say, a problem with s-expressions is that they are so regular that everything looks the same, and when everything looks the same, it can become an obstacle to learning. Mainstream languages are not very regular, but they are more mnemonic. I think Lisp works best for a very particular kind of mind, but that for most programmers its strengths are basically weaknesses.
- aidenn0 11y agoSBCL will warn or error at compile time on the first two, and there are similar issues to the third one in many languages; it's a semantics issue more than a syntactic issue.
- mkramlich 11y agobest constructive takedown of Lisp I've read, thank you. I've had a love/hate relationship with Lisp for years. Yes, its strength is also its weakness. Its so much harder on the programmer at read/review time. Even though at write time its power is unmatched, almost intoxicating.
- lispm 11y ago(if (> x 2) (do-this when-true) (also-do-this when-true)) In some other language: x > 2 ? doThis(whenTrue) : alsoDoThisWhenTrue(); Same problem. Maybe even slightly worse. For example it could be: x > 2 ? doThis(whenTrue) ; alsoDoThisWhenTrue(); To spot the difference between a colon and the semicolon: tough.