I've switched my own back end codebase to Clojure. It's just a joy to work with. Building REST with Liberator is a revelation. It's so easy to reason about what the code is doing, and immutability leads to far fewer bugs. Not missing objects, not at all.
The stock concern for businesses building with Clojure is the lack of talent and industry acceptance. I have a different angle. I figure that when I'm ready to start hiring other developers, I'll only be hiring developers sophisticated enough to see the benefits of using Clojure over Java/Ruby/Python/etc - and then I'll have the draw of letting them work in the best tools, not making them compromise so it's easier for management to hire less serious programmers.
I made two hobby projects in Clojure and the biggest downside to it was the lack of typing (yes, I know of core.typed). Specifically, I found it very intimidating to refactor my Clojure code compared to Java. This isn't apples to apples because I write a lot more tests in my Java code than I did for my Clojure code. But, one of the reasons I went so light on the tests is because I've watched more than one Rich Hickey talk where he seems to make fun of TDD. I assumed he knew something I didn't and that automated tests would be far less important in Clojure than Java.
Could you explain why the difficulty I faced in refactoring Clojure code is not issue for you?
> I'll have the draw of letting them work in the best tools, not making them compromise so it's easier for management to hire less serious programmers.
Why are developers who have not worked with Clojure "less serious" than those who have?
From a startup's perspective (my own), it's not so easy to find Clojure folks. Ever since I founded it I have less time to go to meetups (esp. specialized FP meetups) to recruit people, and most people that I interact with when I mention Clojure just say "What's that?" That's to say, so far I regard it as somewhat of a net loss that our backend is in Clojure.
as a developer, it's harder to find a clojure shop close to my location. More clojure I use, less java/c#/php/python/ruby stuff I am willing to do. This makes interviewing harder for me too. I might just jump back onto non-hipster languages to make my life easier.
Been using Clojure in production for our API (core of the system) for close to a year now, it's been a very interesting ride.
Like many others pointed out, I do wish I had types though: refactoring is a giant pain in the ass even at our modest codebase's scale (10-15k lines), requiring endless UTs to make sure everything's still sane. Dynamic typing is fun for the simpler cases, but as soon as you go into trickier computations like crunching analytics data, you continuously run into run-time type mismatches that take forever to correctly pinpoint. Also having to continuously keep in your head just what exactly you're threading through functions is a pain and requires a lot of mental overhead.
The JVM also doesn't seem to bring much of a benefit to the table, considering that we only ever deploy onto 64bit Ubuntu 12.04, so there's not really a big need for portability.
The best part has been how fun it is to work in clojure and the community around #clojure channel with so many of its freakishly smart people. People on there seem to generally be very willing to help explain something if you're being obtuse.
We've been using Clojure for our web app at work since day 1. The biggest gain by far is the referential transparency[1] built into the core libraries, which has also been closely adhered to by nearly all third party libraries (with only a few unfortunate outliers). I cannot emphasize enough just how much of a gain this has been.
Any posts which explain how the referential transparency built into the core libraries helps? My understanding is that Clojure is impure, so a "partially referentially transparent" design is interesting to me.
Or are you just referring to the fact that the core data structures are immutable?
Not sure if I like the 'some?' operation. It's short for (not (nil? x)).. And has nothing to do with 'every?' -which checks if every element of a collection matches a predicate - ex (every? odd? [1 3 5])
To check if some elements match you need to use (some odd? [2 3 4]) - note the lack of '?'
I'd love to hear the reasoning behind that choice if it's Rich Hickey that did it, since it's called some and every in Common Lisp and he's written a great deal in that language.
Absolutely loving Clojure. I typically hang out in java-land. I tested it out on an annoying problem to scratch an itch and wow, I'm actually enjoying programming again. I find myself looking forward to solving problems with Clojure in a way I haven't for a long time.
I'm in Detroit, and I'm not missing out on Clojure fun. Might miss out on meetups, but everything is still accessible from the Internet, so I don't see your point about NYC. With that said, a lot of different languages have beautiful code, from C, ie Lua source, PHP Symfony, etc. With that said, I love Clojure as well, and it's all because it's Lispy. :)
Like many people on the mailing list, I've been using the Clojure 1.6 betas and release candidates. Don't expect dazzling new features; rather, 1.6 is a nice solid step forward.
Practice problems - 4clojure, exercism.io, clojure koans
Editors - if you want to focus on Clojure not an editor, I'd suggest Nightcode or Light Table. If you like IDEs I'd recommend IntelliJ w/ Cursive or Eclipse Counterclockwise. If you already use Emacs, use CIDER. If you already use Vim, use Fireplace.
There are ~9000 people on the Clojure mailing list and ~8000 members of Clojure meetups on Meetup.com. Hopefully those are useful and concrete numbers.
[+] [-] beat|12 years ago|reply
The stock concern for businesses building with Clojure is the lack of talent and industry acceptance. I have a different angle. I figure that when I'm ready to start hiring other developers, I'll only be hiring developers sophisticated enough to see the benefits of using Clojure over Java/Ruby/Python/etc - and then I'll have the draw of letting them work in the best tools, not making them compromise so it's easier for management to hire less serious programmers.
[+] [-] RyanZAG|12 years ago|reply
Spoken like someone who has never had to actually hire people! It's harder than you think.
[+] [-] tieTYT|12 years ago|reply
Could you explain why the difficulty I faced in refactoring Clojure code is not issue for you?
[+] [-] doktrin|12 years ago|reply
Why are developers who have not worked with Clojure "less serious" than those who have?
[+] [-] Jd|12 years ago|reply
[+] [-] platz|12 years ago|reply
(I know about Typed Clojure; it doesn't seem to have won the hearts of all Clojurians)
(Or, do you just test the bejezus out of the thing?)
[+] [-] dominotw|12 years ago|reply
So basically hire people that think exactly like you. That always works well.
[+] [-] leishulang|12 years ago|reply
[+] [-] BadassFractal|12 years ago|reply
Like many others pointed out, I do wish I had types though: refactoring is a giant pain in the ass even at our modest codebase's scale (10-15k lines), requiring endless UTs to make sure everything's still sane. Dynamic typing is fun for the simpler cases, but as soon as you go into trickier computations like crunching analytics data, you continuously run into run-time type mismatches that take forever to correctly pinpoint. Also having to continuously keep in your head just what exactly you're threading through functions is a pain and requires a lot of mental overhead.
The JVM also doesn't seem to bring much of a benefit to the table, considering that we only ever deploy onto 64bit Ubuntu 12.04, so there's not really a big need for portability.
The best part has been how fun it is to work in clojure and the community around #clojure channel with so many of its freakishly smart people. People on there seem to generally be very willing to help explain something if you're being obtuse.
[+] [-] sdegutis|12 years ago|reply
[1]: http://en.wikipedia.org/wiki/Referential_transparency_(compu...
[+] [-] platz|12 years ago|reply
Or are you just referring to the fact that the core data structures are immutable?
[+] [-] pi-rat|12 years ago|reply
To check if some elements match you need to use (some odd? [2 3 4]) - note the lack of '?'
Bet it will confuse people.
[+] [-] emiljbs|12 years ago|reply
[+] [-] dpassen1|12 years ago|reply
[+] [-] konradb|12 years ago|reply
[+] [-] grandalf|12 years ago|reply
[+] [-] segmondy|12 years ago|reply
[+] [-] elwell|12 years ago|reply
[+] [-] dj-wonk|12 years ago|reply
[+] [-] Morgawr|12 years ago|reply
[+] [-] pjmlp|12 years ago|reply
Congratulations on the work.
[+] [-] TheSmoke|12 years ago|reply
[+] [-] leccine|12 years ago|reply
[+] [-] mark_l_watson|12 years ago|reply
Clojure is a very practical language and basically stays out of your way during development.
[+] [-] thescrewdriver|12 years ago|reply
[+] [-] grn|12 years ago|reply
[+] [-] puredanger|12 years ago|reply
Online - Clojure for the Brave and True, Clojure From the Ground Up are great series. Or try the ClojureBridge curriculum https://github.com/ClojureBridge/curriculum.
Practice problems - 4clojure, exercism.io, clojure koans
Editors - if you want to focus on Clojure not an editor, I'd suggest Nightcode or Light Table. If you like IDEs I'd recommend IntelliJ w/ Cursive or Eclipse Counterclockwise. If you already use Emacs, use CIDER. If you already use Vim, use Fireplace.
[+] [-] puredanger|12 years ago|reply
[+] [-] BadassFractal|12 years ago|reply
[+] [-] craigching|12 years ago|reply
Congrats on the release!
[+] [-] puredanger|12 years ago|reply
[+] [-] poofyleek|12 years ago|reply
[+] [-] elwell|12 years ago|reply
[+] [-] puredanger|12 years ago|reply