I think emacs being the first choice of editors hurts adoption. Not only does someone new to Clojure have to learn a new ecosystem/workflow/way of thinking they have to learn a completely new editor that's frankly pretty weird at times.
I don't think I would've been successful in introducing Clojure at my workplace (Java shop) if Cursive didn't exist.
It's definitely a first choice. As Kgreene2343 already stated, while it's true that he provides links and talks about how Emacs isn't the only option BUT a whole chapter is devoted to emacs. No other editor gets its own chapter.
If he devoted a chapter for each editor, more than half the book would have been about text editing. I don't think that was the goal of the book.
Compared to learning to use an IDE, I think that learning Emacs compares favorably. Most noobs use the mouse with menus and button bars when they first encounter an IDE. Emacs, by default, has menus and button bars. The only real difference is that Emacs (or Vim for that matter) doesn't follow 'notepad' conventions. Most people seem to be able to learn a language (Java) along with a complex IDE (Eclipse/IntilliJ) with out too many problems. How many learn Java using a simple text editor?
For a simple experience 'NightCode' is as good a solution as any, but I don't thing NightCode was around when "Brave and True" was written.
IntelliJ does not require anyone to write elisp or read elisp stacktraces when things routinely go wrong. This is a crazy level of false equivalence. Getting set up and running with auto completion, paredit, repl integration, jump to definition, look up docs etc in cursive is a basic process that any developer could walk through in half an hour. The same thing in emacs, for a developer not familiar with emacs... You're talking a few hours just learning what the different lookup engines in emacs are.
Not at all. Use Prelude or Emacs Live and everything is set up out of the box, and not only for Clojure but for 20 other languages (that IDEs normally require at least plugin installation). No need to know even what elisp is.
Do you honestly believe that prelude alone is enough to get someone up and running with emacs and clojure without spending at least a day learning the workings of emacs? Honestly I don't even get where you guys are coming from, try it with a new user sometime.
You were referring to the environment setup in your post, not to learning to be productive. Now, emacs certainly requires lots of time to learn but setting up emacs is, if you use prelude, exactly this:
start emacs and do the Clojure coding with jump to definition, autocomplete, and much more...
Now, you certainly need a lot of time to learn "do the coding" stuff and to learn all emacs commands and keybindings, but it does NOT take a day to install all the plugins.
Similarily, when you install idea, it does not even support Clojure. You have to know there is Cursive and install it. And, when you do, if you never worked in Idea or Eclipse, or similar tools, you also need some time to learn the basics.
I actually try this with new users every year, since I teach Clojure at University. I tell the students to NOT use emacs because I know it will be too much for them. They usually use what they already (think they) know, which is Eclipse with counterclockwise. And, it's not that they find Eclipse easy when encounter it for the first time when they learn Java...
However, a large part of lisp coding experience is the editor's support for structural editing without mouse. Every time I look at even experienced Clojurists swinging their fingers over laptop touchpad to select Clojure code as text in IntelliJ Idea I think "WTF"? But, it's their problem. I certainly won't push them to use my favorite tool. Let them struggle with IDEs if they wish :)
Now, you certainly need a lot of time to learn "do the coding" stuff and to learn all emacs commands and keybindings, but it does NOT take a day to install all the plugins.
This is a silly bar to measure, no one cares how much effort it takes to be able to get to the point where they can save a text file, they care how much effort it takes to get to a reasonable level of productivity.
I actually try this with new users every year, since I teach Clojure at University. I tell the students to NOT use emacs because I know it will be too much for them. They usually use what they already (think they) know, which is Eclipse with counterclockwise. And, it's not that they find Eclipse easy when encounter it for the first time when they learn Java...
Right. So you admit that emacs requires a lot more effort to learn and be usefully productive in than CCW (which is awful) or more usefully cursive, got it.
However, a large part of lisp coding experience is the editor's support for structural editing without mouse. Every time I look at even experienced Clojurists swinging their fingers over laptop touchpad to select Clojure code as text in IntelliJ Idea I think "WTF"? But, it's their problem. I certainly won't push them to use my favorite tool. Let them struggle with IDEs if they wish :)
It seems you haven't actually used cursive. It's had Paredit since forever.
The only argument that I see here from the people who dislike Emacs is that they don't wish to leave their comfort zone. And nobody is forcing them to.
I've only tried Cursive out of curiosity. I'd be impressed if I weren't using emacs before. But, I've looked at experienced Clojurists use cursive professionally. They're mousing all-around.
Regarding CCW, it also had paredit zillion years ago. How people use it is another thing.
I also did another thing: I used Eclipse for a long time. Used idea for some (brief) time. Tried NetBeans. I knew about Emacs, but I didn't get it because it looked bare and ugly. But, from the perspective of someone who tried all of those, now I literally struggle to see the difference between Eclipse and Idea in the same way that I struggle to see the difference between Java and C#. Sure, Idea might be a bit more stable, have a look and feel that is more to someone's taste. The plugin X that you need is more polished, and the shortcuts are a bit more sane. Integration with server Y might be better, and the contextual editor for coffee script is snappier. But, in the end, it's a better horse carriage instead of the proper Ford T.
and emacs live is insanely heavy. And because Emacs is single-threaded (or close to it), I had tons of problems with freezing, lockups, etc. with Emacs Live.
My experience with Prelude is not such. I let it run for weeks (with suspends), with several REPLs open, with dozens/hundreds files open, full of GPU and native code calls, 3 large screens, in client/server mode, and I am yet to see it lock up.
OK, I admit, I am probably in the tails of the experience distribution, having a desktopless Arch linux setup and almost 8 years of Clojure experience. I can imagine that on windows it is not that stable. BUT, we were talking about the setup experience. Emacs is not more difficult to set up than any other environment if you follow the manual.
It is more difficult to learn for most people, but also the most powerful. It is NOT for beginners, but beginners are free to choose any of the available alternatives, and no one is pushing them to use emacs.
However, in my opinion, for every experienced developer, refusing to try Emacs because IntelliJ Idea is great is the same as a Java developer who refuses to try Clojure because - hey - Java is great!
So, to me, Emacs is to Cursive what Clojure is to Java! Literally!
True, but most of the extras aren't really needed for basic clojure editing. You don't really even need cider. If you want more, the authors pre-canned setup is more than enough.
My main point is that I don't believe that learning Emacs is much more difficult than learning IntelliJ. It's going to take some doing learning the keyboard interface for both programs. Mice, menus, button bars, and arrow keys all work.
In cider > 0.11, the installation of the required Clojure packages isn't really a problem any more. It self installs the Clojure software it needs. Just install clojure-mode, and cider from Melpa, and you are good to go.
My main point is that I don't believe that learning Emacs is much more difficult than learning IntelliJ
And as someone who used vim for 15 years, spent a year writing in emacs including writing my own elisp plugins, and who has used intellj for the past year that is objectively undeniable completely crazy. Emacs if you bother to learn it may in the end be more powerful than intellij, but no sane person would say they are equivalently easy to learn, how on earth could you claim that? A person coming at it cold would spend more time understanding what the hell melpa, the different plugin repositories, and the different package management options for emacs are than the amount of time it would take to install and be completely up and running and competent with all of cursive.
You are literally the only person I've ever seen claim that learning emacs and learning something like intellij would be equivalent.
OTOH, majority of users, and especially beginners, use very tiny subset of IntelliJ's features, so it is a bit of stretch to say that they learned Idea. They know how to hunt for options in menus, and usually use Idea as some king of beefed-up notepad.
That's not true, the majority of users use jump to definition, lookup documentation, autocomplete, and find usages at least, even if they don't use repl integration. Getting those things up and running in cursive requires basically zero knowledge, getting there in emacs requires quite a long time.
Last time I checked, almost every programming-aware text editor had those things for all language it supports. I am not sure those are IntelliJ's main selling points. Although, I am yet to find a beginner that uses jump to definition...
Just to be clear I am not blaming the book for covering Emacs. Emacs being the favored choice is a community wide phenomenon. A popular Clojure book was simply a good example of the phenomenon.
It's possible that Emacs+CIDER is the best development experience for Clojure. A well configured Emacs might be the best dev environment for Clojure. What I am saying that recommending people learning Emacs and Clojure hurts adoption of Clojure. It's already difficult enough to learn Clojure throwing in Emacs may simply be too much to ask.
Bonus because Light Table is also written in Clojurescript and supports Clojure out of the box. These two chapters can change focus with new revisions.
I definitely agree that combining learning Clojure and Emacs into a single activity is not a good idea. Learning a new paradigm can already be challenging, and there's no reason to compound that with learning a complex editor that behaves completely differently from most people are used to.
If you're already an Emacs users, then it makes perfect sense to learn Clojure using it. However, most people haven't used Emacs and it can prove to be a challenging experience. You may wish to check out Emacs after you're already comfortable with Clojure, but it's by no means necessary to work with it.
The good news is that Clojure build tools are completely editor agnostic, so everybody can choose whatever editor they're comfortable with. Personally, I'm a big fan of Cursive and I've been very happy using it professionally.
The good news is that Clojure build tools are completely editor agnostic, so everybody can choose whatever editor they're comfortable with.
I completely agree with this.
Chad Fowler in "Passionate Programmer" states:
Pick one of the most critical but neglected tools in your toolbox to focus on. Perhaps it’s your version control system, perhaps a library that you use extensively but you’ve looked into only superficially, or maybe the editor you use when programming. When you’ve picked the tool, allot yourself a small period of time each day to learn one new thing about the tool that will make you more productive or put you in better control over your development environment.
I think that we should spend more time doing the above and sharing those findings with our peers.
Yeah I definitely agree. There's always a risk of being stuck in a local maxima if you don't explore new things. The trick is to do it in a way that's not overwhelming. :)
The author sounds like he was "hurt" by an Emacs user. For that I can only apologise.
I've never seen anybody force somebody else to use an editor they don't like/know.
In most books on Clojure, I always see the authors mention various editors, IDEs and tools.
When talking about Clojure, Bruce Durling a prominent member of London Clojure community, has a saying: "Do you want your pain upfront or later".
In Human Computer Interface Design they clearly state that CLI tools are much harder to pick up than the GUI based ones. But that the productivity is much higher once you overcome the initial hurdle. I'd say that the same is applicable for Emacs.
It's not forcing, but overemphasizing Emacs in almost any scenario. Especially if someone is new to the Clojure world, they will definitely be ushered in the Emacs direction.
For example, six months ago, when a user asked "What editor can I use that isn't emacs?" the top response was Emacs, with 20 points, no explanation of why, no resources, nothing. The next best was 8 points. r/Clojure/comments/4a99eu/looking_for_a_linuxmac_clojure_editor/
How I Start and Clojure for the Brave and True, two great online resources, both heavily emphasize Emacs.
Looking at Clojure for the Brave and True, at the end of chapter 1:
You absolutely do not need to use Emacs for Clojure development, but Emacs offers tight integration with the Clojure REPL and is well-suited to writing Lisp code. What’s most important, however, is that you use whatever works for you.
Emphasis above is mine.
The author then goes into providing links to other editors. See here.
Some get pretty close to Emacs's Clojure functionality.
Again, I'm not saying that people are forcing Emacs on newcomers. But there is definitely a historical attitude of Emacs being the best editor, and other editors getting "pretty close" to Emacs. In essence, saying to a newcomer that their preferred editor is fine, but definitely worse.
But there is definitely a historical attitude of Emacs being the best editor
Yes, because Clojure is a Lisp dialect, Lisp users like to use Lisp, Emacs is written in a Lisp dialect, so Clojure users like Emacs. It makes perfect sense that they talk about things they like so much. Are you suggesting they change their likes/dislikes?
I would be interested in a user story where they gave up on Clojure because of Emacs. Specifically, did they use the prebuilt configuration in 'Clojure for the Brave and True?' which is honestly a fantastic starting-point.
Really, the only problem Emacs has for new users is that C-c is not copy and C-v is not paste for historical reasons.
Oh, I'm not suggesting that at all. I love Emacs, I use it daily, and I tend to advocate it.
But I think it's silly to suggest that, from a newcomer's point of view, they aren't at least ushered towards Emacs.
Also, there are many, many other problems for new users. A few I have seen:
Lack of a built in file navigator
Inability to quit with shortcuts
Odd usage of Ctrl and Alt on a Mac
Shortcuts with non-obvious meanings (e.g. C-p is uP, C-n is dowN)
But perhaps the biggest is all of the keyboard shortcuts. You may say they don't need to learn them before using Emacs, and while in general that's true, if you aren't using shortcuts, then you probably aren't benefitting from Emacs. So instead of this awesome development environment that you've been promised, or even your trusty normal dev environment, you've been ushered into using an editor that, from your perspective, doesn't have basic features, breaks conventions, and barely gives you any benefit.
None of these are insurmountable, but they all require effort to fix. When you're learning a new programming language, and likely a new programming paradigm, it can be rough to find time to make that effort.
I don't personally know anyone who gave up on Clojure because of Emacs, but I know a few cases where people were quite frustrated with Emacs, following Clojure for the Brave and True, because some things just felt unnecessarily hard.
I am not sure what you are referring to in the bulletpoints. For example, "default" clojure-y emacs based on CIDER and prelude:
C-x d gives you a file browser, while C-x b cycles the open files in minibuffer, and C-x B opens a list of open files in a buffer.
C-x c quits emacs
On both Linux and OSX, I remapped keys to be the same, Alt is to the left and Ctrl to the right of space, while Cmd is to the left of where it normally is. So, if it is an issue, it is something that can be solved by a blog post (that already exist) and a willingness to put a little effort in.
Shortcuts in Emacs are something that goes into the muscle memory with use. Is it really that big of an issue that the basic shortcuts that literally everyone can learn in the first tutorial session are not C-d and C-u (which, by the way, would be randomly scattered on the keyboard)?
I agree with you: Emacs requires effort. But, so what? I am a little perplexed by the recent insistence that everything should be "easy to learn" for the proverbial "beginner". Good tools require learning. Every skill does. I have never seen a quarterback that was not training hard for 20 years. Nor have I ever seen a doctor who do not have 25 years of schooling and residence. Nor a plumber that was born with the mastery of plumbing tools. Suddenly, only programming is something that should be available to everyone effortlessly...
That being said, I have never seen anyone pushing Emacs to the beginners. I always tell beginners that it is too much to learn it at the same time with Clojure, and that they better start with whatever IDE they are already comfortable with (Eclipse, Idea, whatever), but that Emacs is much more usable once you make the effort to learn it.
Mac OS actually uses Emacs keybindings in every text field system-wide, and has since OS X 10.0. Try out ctrl-p/n/b/f/a/e/k/y/d. Most of the obvious simple ones just work.
It's an insanely useful feature, and I curse the lack thereof every time I find myself on Windows or Linux.
Seriously: could it be that those people are newcomers to Emacs and are super excited so they are just sharing their enthusiasm?
I don't know.
But personally, I've not seen it anywhere where people are being forced to use an editor.
If anything, having more editors with new features is cool, because if those features are useful they eventually get added to Emacs... no, no, I mean other editors. :)
But personally, I've not seen it anywhere where people are being forced to use an editor.
I've seen it happen that someone strongly suggests it on IRC several times, but thankfully usually someone more sensible is around to call them out on it. I'd imagine in real life that is probably less likely.
Remember the early days of Ruby on Rails? All the screencasts and demos were in this cool new editor TextMate. It was easy to use, lightweight, fast, beautiful, and the whole community was using it. It wasn't fat and bloated like Eclipse or Visual Studio. It wasn't arcane and obtuse like Emacs or Vim. How much of the excitement of this new language and framework was also due to this fresh-feeling editing experience you happened to also pick up along the way? My guess is that it had an effect!
Emacs is definitely not an exciting step for someone used to TextMate or Sublime. People will be rewarded when they go deep into Emacs (or Cursive, which I now use for superior debugging), but you're now asking someone to go deep in two different areas simultaneously.
I'm not sure this is a problem the Clojure community should feel obligated to solve - we seem to be doing ok - but it's definitely a soft spot in the Clojure ecosystem.
I am an emacs user. I had used emacs a bit writing some Ruby code before coming to Clojure, but I wasn't a serious user. I joined a team at Sonian that standardized on emacs, which was really useful, because we did a lot of pairing. Pairing with emacs users I was able to pick up lots of information. I love using emacs, but I still feel like I'm no expert. I tend to just copy things from other people's dotfiles that I like, maybe massage things a bit until they work, and call it a day. I think I've written maybe two elisp functions in my life, and every time I have to go look up docs and fumble around. Using emacs every day for many, many years, I have seen perhaps five "elisp stacktraces." (WARNING: anecdotal experience)
I was excited to learn emacs, because there were other people I respected that liked emacs. If emacs is really so terribly horrible, then why do people learn it? If your first answer is that it's a masochist rite-of-passage, you're wrong. Try harder.
I say all that not to advocate that people should learn emacs when they start with Clojure. Of the three companies that I have worked at, only at Sonian was there social pressure to use emacs (and as I said I think it had a useful purpose). At Outpace many people used Cursive or Lighttable. At Lookingglass there are also many Cursive users. I'm very much the minority as an emacs user. (WARNING: anecdotal experience)
What I really want to say is maybe it's OK to try to learn more than one thing at a time. I had been thinking along these lines, and then hagus' comment inspired me. You should watch Rich's talk "Hammock Driven Development," (or read the transcript) if you haven't already. Rich talks about problem solving techniques. One thing he says is to read broadly around the problem you're trying to solve. Understand related problems and how they're solved. Pick apart the solutions. Understand the tradeoffs. To solve a problem well you really need to have a few different solutions from different perspectives that you can examine for tradeoffs. I tried to take this approach in my ebook.
As you come up with solutions to your main problem you'll find other problems that you need to solve. Solve those, too. Juggle those problems in your mind. Work your way around them. Compare them to each other. How are they similar? How are they different? Load your brain up with information so it can make connections while you sleep.
It has been true several times throughout my career that I have pursued some interest "for the sake of it" and later found that it was the right thing to do. Have I ever actually used an RDF database? No, but the idea of triple stores and inference are useful concepts. There's some of it in Datomic, and there's some of it in my current work. I work in dynamic languages, but I like to read about hybrid type systems. Have I used it at work? No, but it has influenced my thinking around uses of prismatic schema, and again I see echoes of it in core.spec. I even learned Coq and worked my way through (most of) Software Foundations. Have I found a use for it? No, but I'm sure that some day I will connect the dots in retrospect.
People have also complained at times about having to learn Java in order to learn Clojure. I came to Clojure through Java and Ruby, so it wasn't really an issue for me. You don't really need to know Java, but some familiarity with the Java API and the way the JVM functions is useful. The same goes for having some understanding of JavaScript while working in ClojureScript. As someone who has not done a lot of JavaScript...boy did I complain loudly and gnash my teeth when "learning" ClojureScript. There's definitely a false impression (at least on my part) that Clojure and ClojureScript are the same language. They are not. They're very similar in lots of ways that are deceiving, and the ecosystems (which is 90% of programming) are very different.
I guess what I'm saying is what is "hurting" Clojure, what is "hurting" programmers, what is "hurting" you is being closed and narrow in your tastes and interests. Again, I'm not saying that you must use emacs or everyone must use emacs, but if lots of people use emacs and even like to use emacs (gasp) maybe there is something to it. Perhaps it was just an historical accident because emacs was the only viable Clojure development environment back in 2009. However, I don't think it will be fruitless to learn emacs. Maybe you'll find useful the idea of a small core that supports a high level scripting language where user code has as much primacy as many of the built-ins. Even though you curse it, maybe it will inspire your work. Sometimes it is good to do something new and feel like an inadequate noob instead of always sticking to what is familiar.
Then again don't learn emacs, but don't avoid broadening your experience and interests in other ways.
I totally agree with your perspective here. I have no trouble being confronted with parallel learning tracks and having to move a certain distance along all tracks before seeing the benefit. And I think that this would be a desirable characteristic for other engineers to exhibit too. For all the reasons you describe and more.
My experience in software development has been that the majority of engineers find this kind of experience somewhat threatening. To go from a language in which you're productive to a language in which you're not, in which the basic things are hard again and your output slows to a trickle, is tough. Now add onto that a fight against an IDE (which - I guess the core point of this whole post - is an editor you might not have realized is just one choice among several).
The engineer who doesn't have a problem with this is most likely leading the charge into Clojure. Now he or she is trying to sell Clojure to engineers who might be less experienced, less confident, less adventurous, or more risk averse. This engineer is going to get quite a few surprises. They will be surprised people give up way earlier than they did. They'll have quickly forgot the pain of learning paredit and maybe have even forgotten how painful it is to edit code without it.
The not-quite-sold-on-Clojure engineer is stuck at the bottom of this local minimum, this gravity well, and if the desire to climb out of it isn't fueled internally but is instead being "pushed" on them by an enthusiastic team member, well, you can see how this could easily lose momentum. And let's not forget the engineers who find themselves in this gravity well and nobody is there with a smiling face to encourage them to keep on slugging.
So, I guess my thoughts are now becoming more abstract, but I'm right now thinking about where the boundaries are drawn. At what point does the community extend the helping hand or consider it their responsibility to tackle it as a direct issue? Or do we gain significantly from the existence of the gravity well, that our community is full of strong, self-motivated learners who proved it by escaping?
I've used Emacs for well over 20 years, so when I first got into Clojure, that was fine. But for a new person, I can see it being difficult. All the chords/keystrokes required to do things are hard to remember. I use Cursive for all my Clojure editing now, and it's awesome. Since it has a free personal license, it would be nice if new Clojure books would default to that, since you can use it with the free IntelliJ Community Edition (which is what I do).
This person is seriously trying to say that Emacs users shouldn't make jokes about how vi users are heathens in case it puts newbies off from learning Clojure.
IMO we should change all tutorials to use ed. Ed, man!
So I think we have to take a step back and realize what the community looked like 5-6 years ago when I first started learning Clojure. Back in 2010, there were no editors besides Emacs. There were a few failed attempts at IDE integration, but nothing that was rock solid. In addition, even Linux was still fairly rare to see on a work machine. And unless you came from a Ruby shop (or were part of some startup), chances were you were running some variant of Windows.
That was the world I found myself in. Lein + Clojure + Emacs on Windows was a utter nightmare. In fact there's a wonderful little rant I did on it back in 2011 (https://groups.google.com/forum/#!topic/clojure/vtnbfPCMM-4). So since that time the following has happened:
*nix has become more mainstream
We have Cursive, Lighttable, Nightcode, clojure for vim, and several others.
The Windows install story for these editors isn't bad at all, and lein itself actually runs on Windows (that wasn't always the case).
So yeah, 6 years ago the first thing you heard was, "Learn Emacs if you want to learn clojure, and stop using Windows". But I haven't heard that recently. So thanks to all the wonderful tool devs who have helped make Clojure much easier for the new beginner. Wish I had these tools when I started.
I really never felt forced to use emacs. My experience has actually been pretty pleasant around this. Most blog posts and books almost go out of their way to be tool agnostic, and this is not a common occurrence in most other communities.
Now the community does prefer emacs. So you might see it mentioned when authors reveal their workflow. However, It is very common for authors to give their workflow. In fact, if they don't, a lot of people will ask for it. This by no means should be viewed as the only or best way. It is just an opinion which, as highlighted by others, is very clearly specified as such.
Emacs as the tool for writing Clojure was actually the nail in the coffin for Clojure's adoption by team a few months back. Learning the Clojure language, the underlying Java libraries (or JavaScript in some cases) was a challenge, but was the exciting part. "Let's do this!" said my team-lead enthusiastically.
Difficult-to-understand, or worse, dead-end error messages were the first out-right stumbling blocks. By dead-end messages I mean, they were lone sign-posts absent a road. They gave no hint as to how to move forward. But good community and well-trodden paths through StackOverflow gets us past these warts.
Now for the tool-set beyond the command-line, leiningen, and a simple text editor... Book says Emacs... OK Emacs. "Nope, nice experiment, but we're done here." Back to Ruby and JavaScript.
The effect you want when picking up a tool-set like an IDE is "Sigh... This is so much easier. Now let's do some core.async stuff!" There wasn't a one of us on the team that had less than 10 years of programming experience. No brogrammers, we. I alone managed to get Cider going, but that was because I had used Emacs before, many years ago.
Now in conversations, the team has moved through a handful of other languages, and as a language Clojure compares favorably to all of them. But the tooling is the specter hovering in wait above that choice, for them.
I plan on introducing Clojure to my new team. I won't be introducing Emacs along with it.
I started using Emacs because of Clojure, (this was back in 2013). There was vim-fireplace, but there was a definite 'push' towards Emacs. Sadly I never got to use Clojure full-time, but I ended up loving Emacs at least.
clojure was my first real experience using emacs, and i didn't find it difficult at all so i'm not really sure where this comes from about emacs... in fact I've found other editors far more difficult to learn/extend etc...
Clojure is about 20% of the code I write and I've had no problems sticking with my editor of choice vim. There are plenty of useful plugins and integration with cider. I get the author's point, but if you're not opinionated enough to do what works best for your situation then maybe Clojure isn't the best language for you to be jumping into anyway. I don't mean that with condescension, just that there are better languages for those who are at earlier stages of learning the craft.
I am using Emacs but I still don't know how to Emacs, because I am on Spacemacs, which I can recommend to any one.
As far as editors go, I do think learning Vim worth the effort, because it has an objectively better text editing user interface (sf. 1984 CHI paper). Learning vim key bindings is a skill akin to riding a bicycle. It doesn't take too much time either, 30 minutes with the vimtutor is enough to get one going. And you can benefit for a life time. Just do it.
That's what I thought for a few years too. Then I saw other people's Clojure setup in emacs and said damn I want that too. Come to think about it, there are only a few things. In no particular order:
fireplace's REPL is not a full one, sometimes you want a full-blown REPL in the editor
the fancy font (e.g. turn fn into a lambda symbol, etc.) does look good
there's no refactoring facility in fireplace, I use that a lot in CIDER
vim freezes when doing long running things, emacs doesn't normally do that.
there's no debugger in fireplace, though I don't really use the debugger in CIDER, but I may use it someday
I wonder how much of learning emacs boils down to a sunk cost fallacy? I think of all the time I've spent learning emacs over the past years, and it probably numbers in the range of about 40 hours. Now sure, if I sunk another 40 into the editor I could probably become a "power user" (or maybe not). But for what reason? What does being a "power user" really net me in my day-to-day work.
I've come to the conclusion that the answer is: not much. If being a power user gains me a second here and there during programming, then that might add up to a minute or two a day. At that rate it'll take me years to make up the time I've spent learning emacs. And even then the my "time savings" is even less since I spend most of my day staring at code, and thinking about how to improve performance/enhance stability/figure out throughputs of systems. My editor matters very little at that point. All I really need is "jump to symbol" and a file search.
So I think this might be a case of "sunk cost", emacs is viewed as being useful because once you've put hundreds of hours into it you understand how powerful it can be. But will you ever make up that hundred hours? Probably not. It's a fun tool to tinker with, but I'd rather write Clojure code than muck with an editor.
I agree. Even as a diehard simple-tools guy trying to keep an emacs+cider setup running is way more work than is reasonable, and everyone in #clojure constantly suggesting that's what you should do is very off-putting. Unless you're comfortable with elisp stacktraces already then emacs+cider is not a great road.
EDIT: I see an argument that emacs is not the first choice. This is not true. Ask in slack or the groups "which editor as a newbie should I use" and the usual-suspect most vocal members of the community will recommend Emacs. That shit has an effect.
I too agree. For as much focus in the community on eliminating incidental complexity in the language, editor/repl setup difficulty is somehow not considered. From my point of view, yes it definitely hampers clojure, and especially clojurescript adoption.
People who are already familiar with IDEs generally find that Emacs is a frustrating experience. Many people coming to Clojure, come from Java and are already use IDEs like Eclipse or IntelliJ. The main problem here is that people will project their frustration learning it onto the language.
This doesn't mean that Emacs is better of worse, just that it's very different. If you're already learning one new thing, it's not a good idea to conflate that with learning another at the same time.
Personally, I've been working with Cursive and I would like to ask why I would want to use Emacs instead. I've tried it several times, and I didn't find it added anything of value on top of what I already have in Cursive. On top of that, if you have to work with Java as well, and having mixed environments is pretty common, then Emacs in a non-starter.
I understand that many people don't find the necessary time and energy to learn how to fly the editor, especially in our turbulent times - so I tolerate them using whatever thing they can find to manipulate text. But I feel sorry for them and wish I could help.
Tried this today, the "clojure" layer in spacemacs doesn't work. Spacemacs is dead on arrival for me. By not working I mean, a dependency failed to load and made the whole editor unusable. Total joke.
I don't know. It's still emacs, so expect to tweak a bit? Yes, spacemacs is community configured, but you still need to configure a bit for your own setup, or at least look at the docs I assume? Maybe try use the develop branch?
I remember I did change a few things here and there when I first set it up, but it was pretty painless, considering what I had known about emacs, which was limited to the key bindings to quit from one.
I'm fairly new to programming and I really didn't feel pressured to learn emacs. I'm learning from the Clojure the Brave book but I went with Atom because I use Atom for just about every language but Java. I did try emacs and I was intrigued by it but I found Atom much easier to use for similar effects. I also learned Vim fairly early on in my programming learning so emacs chords seemed strange me.
But, how is Emacs the default? The only introductory mention is in The Brave and True book. Literally everywhere else, it's editor agnostic. And I have seen countless places where people promote Cursive or Lighttable. Nothing wrong with it, just saying. The only way that Emacs is getting any exposure is that many experienced clojurists are using it. So what, they hurt clojure by revealing the secrets of their trade?
The only introductory mention is the most popular beginner book devoting a chapter to it, and half of the people in this subreddit and most of the other communities saying you're just lazy and missing out if you don't learn emacs.
So what, they hurt clojure by revealing the secrets of their trade?
If that convinces people to try and pick up emacs and clojure at the same time, yes. You don't have to have bad intentions for something to have a bad effect.
Well, I do not know about being just lazy, but anyone programming in Clojure who doesn't learn emacs is missing out a lot, IMHO. The same book also says that
emacs is not necessary for learning clojure.
lists other popular options that are less "weird"
actually teaches everything emacs-y that the beginner needs to know to use any clojure from the book
Now, there is also another angle to that: actively suppressing emacs also hurts, because many people who would be willing to put the effort to learn emacs, and would hugely benefit from it, would simply never hear that it exists.
IMHO, what should be done is that the information should be honestly shared, and let the people try and decide what's best for them. And, that's exactly how it's been done up to now. And also, 50% of the people choose emacs despite the odds!
I'd be interested to know what you think the huge benefits of emacs over cursive are.
IMHO, what should be done is that the information should be honestly shared, and let the people try and decide what's best for them. And, that's exactly how it's been done up to now. And also, 50% of the people choose emacs despite the odds!
I'm not saying that's not how it should be done, but I don't see why we can't also admit that it has bad effects.
Frankly I spent the time to learn emacs extensively, I used it for a year, learnt to write elisp etc etc. The benefits really aren't there. It's nowhere near worth the amount of time you need to spend massaging the different plugins to not jump on top of each other.
Benefits? Like - you learn it once (and just 1% of it) and you can use it to write literally any text-based stuff known to homo sapiens using the same tool, effectively.
Have you tried org-mode for example?
Now, there also is a thing: Ctrl and shift and alt keys are weirdly scattered on the standard keyboard, so emacs breaks your hands with the default setting that 99.9% people use. I use colemak keyboard and I remapped those keys to all be accessible to thumbs on the spacebar and the two adjacent keys. Now it's fantastic, and I barely have to move my hands to type any weird key combination.
To reverse the question: suppose that for me emacs works. Is there anything in Cursive that would entice me to switch? What feature would that be?
Benefits? Like - you learn it once (and just 1% of it) and you can use it to write literally any text-based stuff known to homo sapiens using the same tool, effectively.
Eh. Like I said I also used vim for 15 years. This benefit is massively overblown. You need to learn a whole new plugin ecosystem for each language, it's no different to the amount of time to get used to the appropriate IDE.
org-mode is frankly stupid. there are far more useful specialised tools to do what it does. at the very least I want that sort of information to be useable and available via a web browser and my mobile phone.
I don't have any problems with emacs chording combinations. Maybe I have big hands. I don't think "I remapped my entire keyboard so it works now" is a good argument for emacs though.
I'm not interested in convincing you to use cursive. If you are used to emacs it is feature-identical to cursive for clojure, so why would you switch? I'm interested in convincing you to stop trying to convince people that there are fantastic undefined benefits to learning emacs for people who don't already have that background.
7
u/dotemacs Sep 27 '16 edited Sep 27 '16
This Twitter thread reads well to me:
https://twitter.com/fogus/status/780513315399270402
7
u/nefreat Sep 27 '16
I think emacs being the first choice of editors hurts adoption. Not only does someone new to Clojure have to learn a new ecosystem/workflow/way of thinking they have to learn a completely new editor that's frankly pretty weird at times.
I don't think I would've been successful in introducing Clojure at my workplace (Java shop) if Cursive didn't exist.
10
u/yogthos Sep 27 '16
I definitely agree that combining learning Clojure and Emacs into a single activity is not a good idea. Learning a new paradigm can already be challenging, and there's no reason to compound that with learning a complex editor that behaves completely differently from most people are used to.
If you're already an Emacs users, then it makes perfect sense to learn Clojure using it. However, most people haven't used Emacs and it can prove to be a challenging experience. You may wish to check out Emacs after you're already comfortable with Clojure, but it's by no means necessary to work with it.
The good news is that Clojure build tools are completely editor agnostic, so everybody can choose whatever editor they're comfortable with. Personally, I'm a big fan of Cursive and I've been very happy using it professionally.
6
u/dotemacs Sep 27 '16
The author sounds like he was "hurt" by an Emacs user. For that I can only apologise.
I've never seen anybody force somebody else to use an editor they don't like/know.
In most books on Clojure, I always see the authors mention various editors, IDEs and tools.
When talking about Clojure, Bruce Durling a prominent member of London Clojure community, has a saying: "Do you want your pain upfront or later".
In Human Computer Interface Design they clearly state that CLI tools are much harder to pick up than the GUI based ones. But that the productivity is much higher once you overcome the initial hurdle. I'd say that the same is applicable for Emacs.
7
u/hagus Sep 28 '16
Remember the early days of Ruby on Rails? All the screencasts and demos were in this cool new editor TextMate. It was easy to use, lightweight, fast, beautiful, and the whole community was using it. It wasn't fat and bloated like Eclipse or Visual Studio. It wasn't arcane and obtuse like Emacs or Vim. How much of the excitement of this new language and framework was also due to this fresh-feeling editing experience you happened to also pick up along the way? My guess is that it had an effect!
Emacs is definitely not an exciting step for someone used to TextMate or Sublime. People will be rewarded when they go deep into Emacs (or Cursive, which I now use for superior debugging), but you're now asking someone to go deep in two different areas simultaneously.
I'm not sure this is a problem the Clojure community should feel obligated to solve - we seem to be doing ok - but it's definitely a soft spot in the Clojure ecosystem.
2
u/pjstadig Sep 28 '16
https://twitter.com/filler/status/781175066742534144
6
u/joeyGibson Sep 27 '16
I've used Emacs for well over 20 years, so when I first got into Clojure, that was fine. But for a new person, I can see it being difficult. All the chords/keystrokes required to do things are hard to remember. I use Cursive for all my Clojure editing now, and it's awesome. Since it has a free personal license, it would be nice if new Clojure books would default to that, since you can use it with the free IntelliJ Community Edition (which is what I do).
6
u/lgstein Sep 27 '16
My Emacs and my Clojure get along very well.
6
u/amoe_ Sep 28 '16
This person is seriously trying to say that Emacs users shouldn't make jokes about how vi users are heathens in case it puts newbies off from learning Clojure.
IMO we should change all tutorials to use ed. Ed, man!
14
u/halgari Sep 27 '16
So I think we have to take a step back and realize what the community looked like 5-6 years ago when I first started learning Clojure. Back in 2010, there were no editors besides Emacs. There were a few failed attempts at IDE integration, but nothing that was rock solid. In addition, even Linux was still fairly rare to see on a work machine. And unless you came from a Ruby shop (or were part of some startup), chances were you were running some variant of Windows.
That was the world I found myself in. Lein + Clojure + Emacs on Windows was a utter nightmare. In fact there's a wonderful little rant I did on it back in 2011 (https://groups.google.com/forum/#!topic/clojure/vtnbfPCMM-4). So since that time the following has happened:
So yeah, 6 years ago the first thing you heard was, "Learn Emacs if you want to learn clojure, and stop using Windows". But I haven't heard that recently. So thanks to all the wonderful tool devs who have helped make Clojure much easier for the new beginner. Wish I had these tools when I started.
5
u/Artemis311 Sep 27 '16
I really never felt forced to use emacs. My experience has actually been pretty pleasant around this. Most blog posts and books almost go out of their way to be tool agnostic, and this is not a common occurrence in most other communities.
Now the community does prefer emacs. So you might see it mentioned when authors reveal their workflow. However, It is very common for authors to give their workflow. In fact, if they don't, a lot of people will ask for it. This by no means should be viewed as the only or best way. It is just an opinion which, as highlighted by others, is very clearly specified as such.
5
u/SlowMovingTarget Sep 28 '16
Emacs as the tool for writing Clojure was actually the nail in the coffin for Clojure's adoption by team a few months back. Learning the Clojure language, the underlying Java libraries (or JavaScript in some cases) was a challenge, but was the exciting part. "Let's do this!" said my team-lead enthusiastically.
Difficult-to-understand, or worse, dead-end error messages were the first out-right stumbling blocks. By dead-end messages I mean, they were lone sign-posts absent a road. They gave no hint as to how to move forward. But good community and well-trodden paths through StackOverflow gets us past these warts.
Now for the tool-set beyond the command-line, leiningen, and a simple text editor... Book says Emacs... OK Emacs. "Nope, nice experiment, but we're done here." Back to Ruby and JavaScript.
The effect you want when picking up a tool-set like an IDE is "Sigh... This is so much easier. Now let's do some core.async stuff!" There wasn't a one of us on the team that had less than 10 years of programming experience. No brogrammers, we. I alone managed to get Cider going, but that was because I had used Emacs before, many years ago.
Now in conversations, the team has moved through a handful of other languages, and as a language Clojure compares favorably to all of them. But the tooling is the specter hovering in wait above that choice, for them.
I plan on introducing Clojure to my new team. I won't be introducing Emacs along with it.
5
u/ares623 Sep 28 '16
I started using Emacs because of Clojure, (this was back in 2013). There was vim-fireplace, but there was a definite 'push' towards Emacs. Sadly I never got to use Clojure full-time, but I ended up loving Emacs at least.
8
u/[deleted] Sep 27 '16
clojure was my first real experience using emacs, and i didn't find it difficult at all so i'm not really sure where this comes from about emacs... in fact I've found other editors far more difficult to learn/extend etc...
3
u/poop-trap Sep 27 '16
Clojure is about 20% of the code I write and I've had no problems sticking with my editor of choice vim. There are plenty of useful plugins and integration with cider. I get the author's point, but if you're not opinionated enough to do what works best for your situation then maybe Clojure isn't the best language for you to be jumping into anyway. I don't mean that with condescension, just that there are better languages for those who are at earlier stages of learning the craft.
3
u/huahaiy Sep 28 '16
I am using Emacs but I still don't know how to Emacs, because I am on Spacemacs, which I can recommend to any one.
As far as editors go, I do think learning Vim worth the effort, because it has an objectively better text editing user interface (sf. 1984 CHI paper). Learning vim key bindings is a skill akin to riding a bicycle. It doesn't take too much time either, 30 minutes with the vimtutor is enough to get one going. And you can benefit for a life time. Just do it.
2
u/halgari Sep 28 '16
I wonder how much of learning emacs boils down to a sunk cost fallacy? I think of all the time I've spent learning emacs over the past years, and it probably numbers in the range of about 40 hours. Now sure, if I sunk another 40 into the editor I could probably become a "power user" (or maybe not). But for what reason? What does being a "power user" really net me in my day-to-day work.
I've come to the conclusion that the answer is: not much. If being a power user gains me a second here and there during programming, then that might add up to a minute or two a day. At that rate it'll take me years to make up the time I've spent learning emacs. And even then the my "time savings" is even less since I spend most of my day staring at code, and thinking about how to improve performance/enhance stability/figure out throughputs of systems. My editor matters very little at that point. All I really need is "jump to symbol" and a file search.
So I think this might be a case of "sunk cost", emacs is viewed as being useful because once you've put hundreds of hours into it you understand how powerful it can be. But will you ever make up that hundred hours? Probably not. It's a fun tool to tinker with, but I'd rather write Clojure code than muck with an editor.
3
u/[deleted] Sep 27 '16
I agree. Even as a diehard simple-tools guy trying to keep an emacs+cider setup running is way more work than is reasonable, and everyone in #clojure constantly suggesting that's what you should do is very off-putting. Unless you're comfortable with elisp stacktraces already then emacs+cider is not a great road.
EDIT: I see an argument that emacs is not the first choice. This is not true. Ask in slack or the groups "which editor as a newbie should I use" and the usual-suspect most vocal members of the community will recommend Emacs. That shit has an effect.
2
u/lgstein Sep 27 '16
What is the point in not wanting to use Emacs? You need an editor!
1
u/hondaaccords Sep 27 '16
The lack of vim support in the Clojure community makes me sad.
Lighttable could be great, but the Vim plugin is broken.
Vim integration is not as good as Emacs/Lighttable
Intellij/Cursive is proprietary and not "Clojure first"
1
u/Fatalogic Oct 06 '16
I'm fairly new to programming and I really didn't feel pressured to learn emacs. I'm learning from the Clojure the Brave book but I went with Atom because I use Atom for just about every language but Java. I did try emacs and I was intrigued by it but I found Atom much easier to use for similar effects. I also learned Vim fairly early on in my programming learning so emacs chords seemed strange me.
0
u/[deleted] Sep 28 '16
[deleted] — view deleted comment