Hacker News new | ask | show | jobs
by airplane 3617 days ago
Regarding the reliance on Emacs, might not be the case anymore. When I was new to Clojure, I immediately used an IntelliJ plugin called Cursive. It was/is great, same experience as writing Java in IntelliJ. (https://cursive-ide.com/)
2 comments

But the problem is you really do need a "paredit" for your editor when developing in Clojure. It's a double whammy for beginners, and a huge one at that. Pretty much every other language ever is perfectly editable in everyone's editor as it exists today.
Check out parinfer! It's a great new editing mode for lisps that doesn't require memorizing any special commands. It's built into Cursive as well as my own IDE (Nightcode).

https://shaunlebron.github.io/parinfer/

You don't even need a full-blown "paredit", just the ability to jump back and forth between different kinds of opening and closing braces. I've been using vim for Clojure exclusively since I first started dabbling with it in 2011, I'll die before succumbing to emacs... A bigger issue though is that to really sell Clojure you need to sell the alternate mindset of developing it represents as a lisp. With emacs, you can assume slime, and immediately you're exposing people to developing their code iteratively instead of the traditional approach of edit file, save, run from scratch.^1 With every other editor you need to first give beginners^2 something to approximate slime^3, or else you're going to present developing in Clojure the same as you'd present developing in Java, which is to say you'll lose a lot of the punch.

^1 As an aside this is why I'll never be satisfied with plain Java/JavaScript no matter how many new static features they get so long as they remain fundamentally opposed to the build-up style of programming.

^2 By beginner I mean to Clojure; I don't think Clojure is a good language for programming beginners. It is suitable for people as a second or later language, but not their first. So basically I agree the need to explain the preferred editing environment is a hurdle -- if the person's first language was Scheme, maybe there wouldn't be a problem since you don't really-really need paredit or syntax highlighting or auto-indent or anything besides the ability to edit and save text.

^3 For me that's just a separate terminal in a screen session that a vim plugin talks with, though there are others (and probably better, I haven't tried them seriously) for vim.

As a beginner I found that learning a single keyboard shortcut - Ctrl+W - "expand the selection to the surrounding semantic unit" was a huge productivity boost (the opposite action is Shift+Ctrl+W).

Coupled with the setting "Settings→Editor→Smart Keys→Surround selection on typing quote or brace." it's amazing.

Even Atom has nice "paredit" right now. It's not an issue anymore.
My point is you have to use a paren tool to keep lisps sane. That's not true of any other type of language. So when trying to introduce someone to clojure, they see not only a very strange language but a new tool requirement as well. It really creates barriers to entry.
Cursive does have a paredit mode. Works OK for me.
And for those of us who prefer editors (vs IDEs), Proto REPL for Atom (https://github.com/jasongilman/proto-repl) is a great option to work with Clojure. I think it deserves more attention, as it can help a lot with Clojure adoption.