3 ms·
Kind of like saying C often(looks{something{like->this;}});
by betterunix2 6y ago
Kind of like saying C often(looks{something{like->this;}});
- MaxBarraclough 6y agoOverly dense C can be cryptic, sure, but Lisp relies heavily on parentheses. At least in C and C++, there are several types of brackets at work (parentheses, square brackets, braces, and in C++, angle brackets and even double square brackets [0]). This helps the eye get a grasp of things. At least, things seem that way to me, as someone who knows C and C++ reasonably well but has only dabbled in Lisp. [0] https://en.cppreference.com/w/cpp/language/attributes https://en.cppreference.com/w/cpp/language/attributes
- betterunix2 6y agoWell that is kind of the point -- you know C and C++ reasonably well and are comfortable with the syntax, so of course you think it is easy to read. If you were as familiar with Lisp you would not find it hard to read either (I should know, since I am comfortable with both C++ and Common Lisp). That said, if you want a real C++ readability challenge, here you go: int add_one(int x) { return x+1; } Easy-to-miss undefined behavior is a much greater readability problem than the specific syntax of a language in my opinion.
- MaxBarraclough 6y agoI agree that UB is a serious issue in languages like C and C++. I thought you were going in another direction with that example, the Most Vexing Parse. https://en.wikipedia.org/wiki/Most_vexing_parse https://en.wikipedia.org/wiki/Most_vexing_parse
- lispm 6y agoLisp always uses prefix operator symbols. something like { ... } would be (progn ...) . Thus when one reads Lisp, one doesn't look that much for character syntax, but for operator names and list structure layout. Parentheses are there, because s-expression syntax is not only used for syntax for nested lists, but also for representing code as s-expressions. C / C++ does not have that feature. These s-expressions in Lisp are data. This means one can also write programs which create programs as data - not as text, but as list structures.
- MaxBarraclough 6y ago> when one reads Lisp, one doesn't look that much for character syntax, but for operator names and list structure layout. Right, but this boils down to just getting used to Lisp. > also for representing code as s-expressions. C / C++ does not have that feature. Sure, I know enough Lisp to understand that, but the point about syntax stands. Ultimately I think it's just a matter of acclimatisation. C++, Lisp, and Forth, are different enough that if you only know one or two of the languages, you'll likely find the third to be an unreadable mess.