Hacker News new | past | comments | ask | show | jobs | submit login

> how visually distracting the parentheses are (and yes, experience Lisp hackers learn to tune them out; that doesn't change the fact that they are visually distracting

I wouldn't call myself an experienced Lisp hacker, but I don't think the parentheses are visually distracting, any more than I think that the curly braces in C are distracting.

The only problem that I can really see with the parentheses-based S-expression syntax is the fact that it's not always immediately clear where a given S-expression begins and ends. This is a that's-a-feature-not-a-bug situation, though, because that visual ambiguity is a byproduct of the list-code symmetry that makes Lisp so powerful. This comes at the cost of some initial visual ambiguity. Even in Lisp, some sacrifices have to be made. The one thing that's a huge help, though, is Vim's auto-highlighting feature, which lets me know easily where the other half of a parentheses/brackets/etc. pair is. (This isn't unique to Lisp - it will do that for any open-close token pairs in any language).

Pretty Lisp seems to be an attempt to correct that more than it is an attempt to 'correct' the parentheses, which I view as a strength rather than a shortcoming of Lisp. A much simpler way to achieve that end goal would be to write a short Vim keybinding/plugin that would either automatically or manually (toggle on/off) highlight the entire function/list that the cursor is on, instead of just the opening and closing parentheses.

To me, that would be the best of both worlds, and it would probably be a very simple task for someone familiar with Vim configuration.




Parentheses highlighting is only a half-solution -- I don't know if there's a Vim equivalent, but you could check out Paredit for Emacs.


After spending time with Paredit, all other code editing always seems so woefully limited. Transpose, for instance becomes very powerful when we are talking about blocks of code rather than simple syntactical elements.


There's a plugin for rainbow parens.

http://www.vim.org/scripts/script.php?script_id=1230


> Even in Lisp, some sacrifices have to be made.

This makes me smile. It points out the concept that while Lisp, is in fact a programming language in that way that most are. After spending lots of time in it, it really can feel infinite in a way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: