
Ask HN: How to pick up Clojure for web dev? (coming from RoR background) - conqrr
Whats the equivalent of Mhartl&#x27;s tutorial for clojure?
======
johnny_utah
Before getting into web dev with Clojure, I recommend reading and doing the
exercises from Clojure for the Brave and True to learn the language itself. It
is one of the most engaging technical books I have come across in some time.
[http://www.braveclojure.com/](http://www.braveclojure.com/)

After that, I would go to the clojure docs to get started with web dev in
clojure: [http://clojure-
doc.org/articles/tutorials/basic_web_developm...](http://clojure-
doc.org/articles/tutorials/basic_web_development.html) The luminus framework
has a good tutorial to get started as well:
[http://www.luminusweb.net/docs](http://www.luminusweb.net/docs)

Caveat: I do not code clojure as part of my day job.

~~~
zura
Looking at ToC, the odd thing about Clojure for the Brave and True is that the
very last chapter is:

Chapter 13: Creating and Extending Abstractions with Multimethods, Protocols,
and Records

... This chapter serves as an introduction to the world of creating and
implementing your own abstractions.

Wouldn't it make more sense to introduce tools for creating your abstractions
at least in the first part of the book?

~~~
bgar
No because the topics in that chapter are advanced.

~~~
zura
Multimethods - maybe, but I think Records should be introduced much earlier,
and probably Protocols as well.

Creating abstractions shouldn't be the most advanced topic in the language.

~~~
zura
EDIT: One interesting observation (from the outsider's perspective) - As I
see, Clojure encourages use of primitive/language-provided data structures
such as maps, lists, etc.. instead of creating your own abstractions and
"inventing languages" (this is mentioned in a negative context, in Clojure
docs). This is radically different approach compared to e.g. SICP, where
creating many mini languages is actually encouraged. I personally find Clojure
approach messy and unstructured (Also browsing a code in the wild). Anyway, as
I can tell, Clojure has enough support to create well structured abstractions.

------
samridh90
There's a really good step-by-step introduction to Clojure here:
[https://aphyr.com/tags/Clojure-from-the-ground-
up](https://aphyr.com/tags/Clojure-from-the-ground-up). From there, you could
check out Ring ([https://github.com/ring-
clojure/ring](https://github.com/ring-clojure/ring)) which is a Clojure based
web application library inspired by RoR/Python WSGI.

~~~
sova
Yeah, Ring is where it's at.

------
147
There really isn't an equivalent to Mhartl's tutorial for clojure, mostly
because there aren't really web frameworks in Clojure. I went from Rails to
Clojure a few years back, it was a rough transition because I was used to
having a framework do everything for me and in Clojure you have to pick your
own libraries and compose them.

------
jarcane
I will be starting on a tutorial project soon for my employers, developing an
API and frontend client in Clojure with compojure-api for backend, and
ClojureScript + reagent for the front-end, with possible fun diversions into
Raspberry Pi support and even mobile apps if I can puzzle my way through the
still early React Native support for ClojureScript.

In the meantime, for the basics, I started with the Koans.
[http://clojurekoans.com/](http://clojurekoans.com/) I found them a largely
excellent way to get up to speed with the language by doing some actual
coding.

------
GetContented
There's a really good book:

[https://pragprog.com/book/dswdcloj/web-development-with-
cloj...](https://pragprog.com/book/dswdcloj/web-development-with-clojure)

It goes over most of the things you would want to know. Plus, yeah, Luminus.

------
zubairq
You could also try something like AppShare made by someone with a Ruby On
Rails background:

[https://github.com/zubairq/AppShare#the-long-story-of-
appsha...](https://github.com/zubairq/AppShare#the-long-story-of-appshare)

------
DrScump
You might try looking at this other thread:

[https://news.ycombinator.com/item?id=10959523](https://news.ycombinator.com/item?id=10959523)

