Hacker News new | past | comments | ask | show | jobs | submit login
How I Start: Clojure (howistart.org)
285 points by gigasquid on April 7, 2015 | hide | past | favorite | 42 comments

Nice. I think this meets an important need in the Clojure tutorial space, focusing on the many dimensions of a typical problem-solving workflow rather than the tool setup or language itself. This sort of "how do you get stuff done" description, touching on package management, REPL exploration, coding, testing, deployment, connecting with APIs, etc. is useful in helping people gain confidence and productivity. It's long, but for someone who's a beginner to intermediate, working through this kind of well thought out and comprehensive slice of Clojure development is really worthwhile.

+1 This is a nice dive with some immediate gratification. I got a lot of encouragement from Clojure for the Brave and True http://www.braveclojure.com/. It is a deeper read (gets to core.async), but still fun in the spirit of "why's Poignant Guide to Ruby" and "Learn You a Haskell for Great Good".

Seconded. When I was getting started with Clojure I had a ball with these set of tutorials - http://iloveponies.github.io/120-hour-epic-sax-marathon/

If you're looking for clojurists... Note that Carin's looking for new opportunities right now.

She's also the author of http://shop.oreilly.com/product/0636920034292.do

I worked with her in a past life, she's great to work with, I'd recommend her for any team.

seems like a nice book, would love to hear some reviews from the early release version

Great writeup. Side note: If it were upto to me, I'd recommend Cursive Clojure (with IntelliJ) to beginners. No steep learning curve and works flawlessly!


EDIT: Added link

I'm a beginner and Clojure is on my list to try out, so this tutorial comes in handy. However I was looking to use LightTable - is this still a good choice?


Light Table is the least hassle to setup and it's serviceable for smaller projects. However, I would definitely recommend using something like Cursive for any serious project.

I second this. Although I myself use Emacs and am very happy with it, Cursive allows focusing on Clojure and not on the setup. Though once some level of skill has been achieved, I'd recommend Emacs. :)

Why though? Cursive has a working debugger while Emacs doesn't. Emacs has a lot of stuff outside the realm of Clojure, like irc mail and orgmode, but Cursive really is the more advanced Clojure environment. Even @dnolen seems to have switched to it.

Actually Emacs does have a Clojure debugger now. http://endlessparentheses.com/cider-debug-a-visual-interacti...

Maybe it's just my 4gigs of RAM speaking, but Cursive is sluggish and heavy. I have Emacs running in a drop down terminal, that I can hide and show fast, I can run many languages simultaneously (Python and Clojure for me), I can quickly navigate and to all sorts of things without any load time. Everything feels very effortless, thus why I'd recommend Emacs. Not to say that I am above opening up Cursive for serious refactoring or navigation. :)

NB: I personally also hate using the mouse.

I'd recommend it until recently. I'm unsure why, but even with a fresh install of IDEA it fails outright and refuses to load on both of the machines I have it installed on.

I'm sorry about this - as other commenters have mentioned, you need to change your plugin repo when you change your IntelliJ version. This is due to unfortunate bugs in the IntelliJ private repos (see https://github.com/cursiveclojure/cursive/issues/813 and the associated YouTrack issue if you'd like lots of gory detail).

Be aware that the plug-in repositories follow the version of Idea, so when upgrading you'll need to uninstall and reinstall with the correct repo. Hope this helps!

I stumbled across this yesterday - it is a known issue with IDEA 14.1. There's instructions on a fix here: https://github.com/cursiveclojure/cursive/issues/813

A bunch of people are going to think "what's the difference," but it felt awesome to get to the end of this and see that a woman had written it.

Carin is awesome. Author of such classics as Hitchhiker's Guide To Clojure [1] and World Domination With Hexapods and Clojure [2]. And I think she has a book coming out soonish? Thanks gigasquid, this was a lovely warmup to start my day.

[1]: http://hitchhikersclojure.com/

[2]: http://gigasquidsoftware.com/blog/2014/03/20/world-dominatio...

Her book is "Living Clojure", from O'Reilly:


I really don't see the advantage of trying to sell clojure and emacs as a package, it just alienates a lot of potential newcomers. Sadly almost every Clojure tutorial I've seen so far does this.

Most tutorials for other programming languages simply go with a text editor of your choice + a console repl.

Agreed, learning Emacs while learning Clojure is just a bad idea. It's a huge distraction and it ties the success of learning Clojure into the success of learning Emacs (which will never be everyone's thing) and reduces your speed while learning.

If you really want to evaluate stuff inline and get a more LISPian experience, use LightTable, not Emacs. But even then, I'd recommend against that. Use what you know.

You said it better than me.

If you look at the rest of the posts on howistart.org you'll see that each mentions in some way the authors development environment of choice. This is on purpose, howistart is meant to be opinionated and show how the author works, not attempt to be generic.

I'll second this; there's a huge amount of value to be gained by reading opinionated pieces from experienced software developers. Many times it's just inspiration in the form of "huh that's cool, I wonder how I can integrate that feature/technique into my own workflow ..." I think that's also part of the appeal of watching other programmers livestream, though unfortunately there the signal to noise ratio is so much lower there than a well written article.

Well... I may be biased as one of those folks who uses both vim and emacs, but: there is a big (positive) difference in my opinion between evaluating code in-line, right from your source file, in your editor, than copy+pasting it into a REPL somewhere. Loading up your ns in cider and then being able to evaluate functions, edit them, and see their output right in emacs is terrifically powerful. Even in SublimeText or IntelliJ or something you have to wrap the function in question in a print statement to do that, sometimes affecting lexical scope, etc.

No, you don't - in Cursive (in IntelliJ) you have always been able to send forms directly to the REPL from your editor. I think all good Clojure environments allow this.

I'm an ex-Clojurian using Haskell, and my time spent in console REPL vs. Emacs Haskell REPL is pretty evenly split.

I'm was quite grateful the terminal REPL (ghci) is better than `lein repl`. Which I use (Emacs vs. term) in what circumstance depends in part on how long I'm going to be heads down on the problem I'm working on.

Well, the series is titled "How I start" after all. It's not "How you might want to get your feet wet" -- it's "How I, that actually have used X in anger, get stuff done". That doesn't mean your point isn't valid, but I think showing off how the author actually works makes sense in this context.

>I really don't see the advantage of trying to sell clojure and emacs as a package

Because Emacs is the best Lisp editing environment, hands down.

Lots of people disagree on that point, of course.

Depends on the lisp.

Huh? That was the first thing about it that caught my interest!

I really would have benefitted from this when I was learning Clojure. There were a lot of "Getting Started" tutorials, but I could never find any that quite scratched the "experienced dev trying clojure for the first time" itch.

> "experienced dev trying clojure for the first time"

You're looking for Seven Languages in Seven Weeks http://www.amazon.com/Seven-Languages-Weeks-Programming-Prog...

This is an excellent tutorial, kudos to the author! As an additional supplement for beginners I'd also suggest solving some coding challenges in Clojure on pages like HackerRank. It's addictive fun and supplies cool problems to solve at will, made a big difference for me.

The http://www.4clojure.com/ site does a great job of this.

Absolutely. The quality of other's solutions and the more Clojure centric atmosphere are pluses compared to for ex. HackerRank. The reason why I personally chose HackerRank over 4clojure was the Ranking/Badge/Percentile central theme. I just got hooked on competing with other people and upping my profile. Though now I am thinking I should give 4clojure another go..

I would recommend the Nightcode editor (https://sekao.net/nightcode/) for those running Windows as it comes with a integrated Leiningen and Clojure compiler. Installing Leiningen on Windows is a huge PITA as the install scripts are pretty flimsy and won't install properly on 64bit Windows, especially in a multi user environment.

Yeah, this is a real pain point for Windows users. Cursive and CCW also bundle lein, and I just fixed lein project creation within Cursive for this very reason (out in the next drop, today or tomorrow).

I really like this website and hope it continues to add examples. As a Microsoft oriented developer, it's nice to be able to peek over the shoulder of someone who is knowledgeable in another area and see how they do things.

Great writeup. I have been using Clojure for years, and I still got good ideas from this article.

BTW, I have been reading through Carin's (still beta) book Living Clojure - also recommended.

Great job Carin!

Applications are open for YC Summer 2021

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