Clojure gives you massive benefits, but god it's a brutal road to competence. Things that should be simple like setting up a web server, adding user authentication, making JSON API's, trying to find the best libraries, it's all a time-consuming trudge through pain and suffering. And after some months when you get somewhat competent with the language, you realize that in order to get the full power of Clojure you need to not only learn the Clojure language, but the entire Clojure ecosystem. So you need Clojure, Clojurescript, Datomic, Edn, Core.async etc... And each piece of that puzzle is equally horribly documented and has no beginner resources so you have to struggle at each point in the process, praying to god that it's ultimately worth it.
It's frustrating as hell, but it really is rewarding, because you have to learn every little piece at a low-level to ever make anything happen. There's no Rails-like framework that makes things 'just-work' waiting for you. I find that using Clojure is awesome, but learning Clojure is awful. I'm hoping to play a role in fixing that second part pretty soon, but really wish the community would be more active in helping to remedy the problem. The first step is admitting that the problem exists and it matters, and not sure that we're there yet.
E.g. I'm helping someone with a web application and I've found no need whatsoever for Datomic (PostgreSQL + korma is just fine), I gather that means Edn is irrelevant, Core.async appears to be less than a year old, so I'm not surprised it might be lacking in documentation, and I don't see it as critical for a lot of applications, including mine. Clojurescript: we'll see, I do engines, and would prefer to continue to have others do almost all of that side of things.
Granted, it did take me a while to find and get up to speed on a set of libraries to do the web app I'm working on (mostly CRUD with some non-real time backend external communications), but it's been relatively pain free. I started with a recommended set, then as I found I needed to do something new, like JSON, I found a good library in a few minutes with Google and didn't find it at all difficult to fold it in.
Did change after a bit my form validation library to Red Tape, which modulo one detail (limited data available to form level cleaners (functions that act on more than one item in the form)) is superb.
And "superb" in general describes my experience doing all this. And I fully expect documentation and other learning resources to continue to improve as Clojure gets greater acceptance.
(Disclaimer: I'm an old Lisp and Scheme hand, e.g. not someone who had to learn anything conceptually new to use loop and recur. I could see the above plus learning basic functional Lisp concepts to be brutal if you're new to everything.
On the other hand, I can remember the days when learning MACLisp required reading an old David Moon manual and then the archives of a mailing list following it's publication; thank goodness there was a really great Lisp Machine Lisp manual and they were just starting to be somewhat available to use and learn on.)
(This is exactly the behaviour you are point as wrong, and I know it.)
The resource I had (back in the 2011/2012) were just a book, `The joy of Clojure`, my background was some C and mostly python, nothing about FP.
I don't see any of ClojureScript, Edn (???) nor core.whatever so fundamental... Those are just other tools, you can write any webserver using the old JS, JSON and any other lib you may need... (Anyway you should not try to learn clojure building web server, are the less clojure-y piece of software you can build IMHO)
IMHO, the biggest problem is the paradigm shift that most developer need to have in order of learn clojure.
Then again you probably should have listened to all those people telling you to do The Structure and Interpretation of Computer Programs (SICP/6.001) ^_^, I merely lucked out to be at the edge of the community that created it, so it sort of fell into my lap, with strong recommendations that "this is revealed truth" as I like to put it.
In the last couple of weeks I had to write a bunch of those in Clojure for the first time "in anger" (for real), and that part of it was trivial because of the SCIP I'd done in the early '80s. Learning that and pounding in my head for the first time was a bit hard, but well worth it, back then and of course now.
I think there's going to be some efforts in the near future in the Clojure community to tackle the low-hanging fruit of improving beginners' path to mastery.
If you come from OOP school of programming and the Algol/C++/Java style of syntax (true of many popular languages these days), then Clojure does require a re-think of the programming paradigm. But it truly is worth it -- it will make you a better programmer -- and the community is friendly, smart, and always learning and improving. It's certainly a language that I think that I will grow as a programmer by being with.
I base this in part on the very popular Python language's use of white space, which to a seasoned Lisper looks very familiar.
As for the focus on "diversity", I submit it might be misplaced at the moment, especially to the extent AlwaysBCoding's complaints are valid. To the extent Clojure is not making the sale to a target audience that's already 98%" heteronormative eeeevil white male (https://news.ycombinator.com/item?id=7581226), how likely are you to entice those outside that demographic? In fact, if you view Clojure as an experiment that may fail, are you doing them a favor by evangelizing it to them?
(I'd argue yes, since it's probably one of the easiest functional programming (FP) languages to learn, and it really helps to have FP in your toolkit. But I'd argue SICP or something gentler with multipardigm Scheme would be a better approach if you're just trying to accomplish that sort of thing.)
I don't think any serious student should expect to learn only one language. Clojure can teach concepts that any learner will find valuable in applying to other languages. In particular, I think that clear separation of values, identity, and state avoids many kinds of complication in learning how to program that are introduced early with other languages.
I'll start by saying that documentation, examples, getting started, etc could be better and efforts are ongoing to improve all of those to various degrees.
However, there are substantial and rapidly growing resources (http://clojure.org/getting_started) for learning Clojure and other parts of the ecosystem. Some of the more recent beginner resources I'd recommend are "Clojure for the Brave and True" (http://www.braveclojure.com/) and Kyle Kingsbury's "Clojure from the ground up" series (http://aphyr.com/posts/301-clojure-from-the-ground-up-welcom...). There are also many good Clojure books - I'd recommend any of them.
In the web area, the philosophy is different than other languages and it is evolving rapidly (especially on the client side). Luminus (http://www.luminusweb.net/) is a good effort to provide a reasonable set of defaults that tie together the various Clojure web libraries.
So yes, it could be better. However, there are significant resources now and gaps continue to be filled.
You can find a quick installation guide here: http://blog.crudzilla.com/2014/04/hivemind-on-digital-ocean-...
Here's a screencast showing usage of Clojure, it requires no additional setup besides the installation guide above: http://crudzilla.com/assets/img/info-graphics/lang-demo.gif
The other thing is that you cannot learn Clojure without learning Java, despite various claims; the atrocious error messages are just the tip of the iceberg there (and I say this as a professional Java developer).
I personally do not think the error messages are "atrocious". Some error messages are confusing or lack context. There are many tickets in progress to improve those and they continue to get better over time. This is an area we continue to work on within the language.
This is what drove me back to Haskell from Clojure. Haskell is miles ahead in documentation, references, tutorials and tooling. Tools like Hoogle are manna from heaven for beginners and experienced developers alike. Couple that with the self-documenting aspect of types and even undocumented Haskell libraries are grokkable in a reasonable amount of time.
One of the big problems is that it's -really- hard to go back and explain this stuff once you're already an expert, and I metaphorically burts into tears at your comment because if you'd documented all the things you had to learn the hard way as you went, you'd probably've gone a noticeable way towards fixing the problem you describe.
Note: I'm not, at all, trying to criticise you for not doing so. I'm just saying that if you could arrange for this to happen as you mentor somebody else it would be really really awesome :)
I started Clojure for web development. Once I found out about the Compojure template, everything else was just a stone's throw away.
$ lein new compojure myapp
$ cd myapp
$ lein ring server-headless
Server started on port 3000
I wager the average HN reader could run with that. > There's no Rails-like framework that makes things
> 'just-work' waiting for you.
That's actually what stifles the productivity of Rails projects I've worked on. It's why I started looking at other solutions and why the simplicity of Clojure pulled me over. rails g devise:install
rails g devise user
rails g devise:views
Nobody really knows what just happened. Things kinda work til the answers to your questions can't be pasted from Devise's wiki anymore. > because you have to learn every little piece at a low-level to
> ever make anything happen.
Maybe we have different things in mind, here. The alternative to this in my experience is an application where nobody actually knows, for example, what's being put into the cookie, when it's put into the cookie, what part of the session is serialized in the DB, if the cookie is signed, etc.At least that's how it was at all the Rails projects I worked on.
https://github.com/ring-clojure/ring/wiki was refreshing. It turns out that managing your own session/cookie/authentication lifecycle in your own application code is easy. And it turns out that these "it just works" generators doesn't actually save any time because when you want to make trivial changes to them, you have to credentialize in yet another abstraction.
[1]: http://planet.clojure.in/
I knew how clojure felt and behaved, but IMHO you still have to memorize most of the core library, or most code will look confusing.
http://pluralsight.com/training/courses/TableOfContents?cour...
For beginners, getting familiar with namespaces in the REPL quickly is key, if you're trying to load a sample of code froma file.
Also another gotcha is multiple arity functions which I haven't seen before (in a dynamically typed language).
My journey looked ~like this:
1) Managed to get counter-clockwise working, played around with http://tryclj.com/, solved most of the http://clojurekoans.com/, and first ~15 of 99 functional problems that float around the web.
2) what helped, that I have already gone through a course of haskell while undergrad, so functional paradigms weren't that foreign :-) (immutability, laziness, partial application, e.t.c), so if you want to give it a try, you can look at Learn You a Haskell :P
3) we have since moved to python, and when I am sad, I try to write my code without loops, but using (for in) generator for everything, pretending I am still using lisp :P
4) clojuredocs.org/clojure_core/ were quite helpfull but after a year, clojure 1.5 was already out, and lots of functions recieved updated counterparts, so I spent quite a lot of time reading their sources ...
That said I too still can't figure out how to use leiningen and it seems clunky and slow. It's also easy to find examples that don't work. I'm not sure if getting it to work with as little hassle as npm would help it's growth, but seems like it couldn't hurt.