3 ms·
I find it hard to believe you have done much lisp if you are complaining about balancing parens. If you had done a lot of lisp, then you would never care about
by escherize 12y ago
I find it hard to believe you have done much lisp if you are complaining about balancing parens. If you had done a lot of lisp, then you would never care about balancing parens, because there are tons of context-aware tools that do it for you. Not just that - these tools [paredit, smartparens, etc.] make it impossible for one to ever unbalance parens because they're contextually aware.
- azinman2 12y agoTo you and the other posters: You still gotta read the code later. It's not just about input time. The () just cloud things up and can make it slower to understand what's going on IMHO. This is just my opinion/brain, but I also dislike the RP-style notation. 3 + 5 is easier for me to read than + 3 5, especially when you start combining things like (/ 15 (* (+ 3 5) 4)).
- white-flame 12y agoI've not experienced that. I see the indentation more than the parens, in terms of looking at scopes. Browsing through the source code with the cursor highlights matching parens and directly shows which expression you're in. I do agree partially about the math, though. (+ 1 2 3 4 5 6 7) is easier to read for me than 1 + 2 + 3 + 4 + 5 + 6 + 7, but most mixed-operation expressions are easier to human-read infix. S-expressions are also more explicit, eschewing punctuation for an AST representation of code. For example, a[2] becomes (aref a 2). Yes, this explicitness is more verbose, but because it's more regular I'd say it's easier to read when things get complex. However, once you taste the ability to programmatically generate source code right in your code itself, and that becomes part of your common workflow, the benefits of AST s-expressions blow away any of these relatively minor downsides. You can code in an idealized representation, then macro that ideal into actual executing code.
- wz1000 12y agoAfter ~3 years of learning Lisp, I find the second style extremely easy to read.
- progman 12y agoLisp can be extended to support infix expressions. For instance: http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/syntax/infix/infix.cl http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/la...
- lispm 12y agoActually there is some amount of extremely well written code in Lisp. Check out the book 'Paradigms of Artificial Intelligence Programming' by Peter Norvig. It is one of the best books ever written about programming and it explains a lot of Common Lisp. http://norvig.com/paip.html http://norvig.com/paip.html You should have no problems reading this code a week later, a year later or ten years later...