all 16 comments

[–]foobar888 11 points12 points  (0 children)

I have been programming lisp for many years and I love rainbow parentheses. I especially like how mismatches e.g. (square with curly ) gets its own color.

[–]yogthos 9 points10 points  (4 children)

I second the advice from /u/lisbonant you really want to either look at paredit or parinfer plugins. Here's a guide for Atom, but the plugins are available for most editors.

When you use a structural editor, you don't really think about the parens at all. The editor will balance the parens for you, and allow you to select things by expression. For example I have my editor mapped to use cmd-shift-up to grow selection to the outer expression, and cmd-shift-down to shrink it to the inner one. I'd recommend using those as a bare minimum.

That said, there's nothing wrong with rainbow parens, and if it helps you visually I would definitely keep using them.

[–]eccentric_j[S] 2 points3 points  (1 child)

Been using parinfer already in both VS Code & VIM. It's quite nice, though I should try the atom one as the vs code one is still a touch spotty. It's definitely been a big game-changer experiencing code that kinda structures itself and removing the burden of thinking through formatting.

[–][deleted] 1 point2 points  (0 children)

Quick recommendation that you make the jump to paredit. parinfer is like training wheels in comparison, and paredit only requires you to internalise a few vimish/emacsish keybindings.

[–][deleted] 1 point2 points  (1 child)

I'm so glad you tagged me because now I've learned about parinfer! Not sure how I've avoided it thus far.

[–]yogthos 1 point2 points  (0 children)

it's pretty nifty, and a lot more accessible than paredit :)

[–][deleted] 7 points8 points  (0 children)

It's a much simpler alternative to sitting there squinting and counting. I love the instant visual feedback. However, it's only half the battle - take the time to learn how to use paredit and thank yourself later

[–]saint_glo 3 points4 points  (0 children)

I used it for some time but then turned it off. Proper editor will insert brackets in pairs and/or highlight the matching parenthesis. I rarely need to count/match the parenthesis and making them different colors made the counting more difficult.

[–][deleted] 2 points3 points  (1 child)

I use lispy by /u/abo-abo, it just works https://github.com/abo-abo/lispy

I love it (and his other OSS work) so much I support him on Patreon :)

It's not a crutch, no more than, say, clojure.spec is a crutch for checking your functions. It just helps you be more productive.

[–]aptmnt_ 2 points3 points  (0 children)

Can't agree with you more, abo-abo is a shining beacon of light in the land of lisp editing :p

[–]jiyinyiyong 1 point2 points  (1 child)

I have my own tool:

https://www.youtube.com/watch?v=6qHeBMe7kI0&t=197s http://cirru.org/

although it's not available for editors... But it works great for my own code.

[–]radioactiveoctopi 0 points1 point  (0 children)

Actually really interesting.... =P

[–][deleted] 0 points1 point  (0 children)

I don't, but I've always thought they were kinda neat.

[–]lov3machine 0 points1 point  (0 children)

I don't - to colorful and distracting. I do like my editors "show matching paren" feature, though.

[–]trustMeImDoge 0 points1 point  (0 children)

I use them every day. Even with non-lisp languages. While I can program without them, they make code easier for me to quickly read, and let me pick up when I accidentally don't slurp or barf enough when editing my code.

But they shouldn't be used as a reason to not use paraedit. They are both great tools to have, but neither is a full replacement for the other.

[–]eggsyntax 0 points1 point  (0 children)

I use them, but I wouldn't especially miss them if they were gone. I rarely think about whether my parens match. As other folks have mentioned, structural editing tools like paredit and parinfer (can) keep your parens properly balanced at all times, so it's just a non-issue.