" However, we had a strong aversion to using Java itself, so the real short list was Scala or Clojure."
Sadly they couldn't articulate any actual problems with Java...
I find it weird that so many developers focus on the "writability" of the language. I mean stuff that java gets criticized for, like verbosity etc. Which I don't even find so bad especially since the newer jdk versions.
But in my opinion the _readability_ of the result is the most important factor. I rather read copy/pasted code than some smart clojure onliner which nobody dares to touch or really understands.
You only write the program once, but you have to read it over and over again when maintaining it and developing new features, and java's maybe a little verbose syntax really helps here, and also the fact that there really is only one way to do a thing (unlike eg. perl).
The tooling, documentation, frameworks, libraries and runtimes are all top notch with java. All other languages seem to have problems in one (or more) of these areas.
Clojure allows me to express thoughts that I wouldn't know how to express in for, while, if, variables and objects.
And on readability, what do you prefer?
List even = new List()
for(int i = 0; i < 100; i++){
if((i%2)==0){
even.add(i);
}
}
return even;
vs. (filter even? (range 0 100))
But what is even?
I am sure functional programming has its natural appealing in areas like recursion, but this example doesn't seem too convincing for winning readability, I can always write this in python
filter(even, range(0, 101)))
where even is a function I wrote.
Please give an example for "Clojure allows me to express thoughts that I wouldn't know how to express in for, while, if, variables and objects." if you can.
We were talking about java here. ^^ So python is offering a lot more already with it somewhat first class functions. What would you guess even? does, btw?
But sure, let's make things a bit harder. As below, let's produce a sequence of the form [true false false true true true false false false false ...] of exact length 1000 without computing any more than exactly 1000 elements.
(take 1000 (mapcat (fn [i] (repeat i (odd? i))) (range)))
Of course the really interesting stuff is hard to do in one liners. But I think one of the more mind bending things is probably core.async. Go style coroutines and channels implemented as a library on top of the language. Which allows for concurrent programming inside clojurescript which is compiled to JS and thus inherently single-threaded.My point was "even" and "filter" can be built by someone, just to be fair about the whole readability. If "even" is already built into the language, then that's a given.
Readability and language understanding are not separable. I for one have a hard time actually understand what the code does above (although I can guess it). But I am not sure how ^ translate into [true false false true true true false false false false ...] sequence because, I thought we were calculating oddity of 1000 numbers.
[1 2 3 4 5 6 7 8 9 10 ...] ==> [T F T T F T F T T T ]
Perhaps the lack of understanding Clojure syntax to comprehend what the code is doing.
Python also allows for functional programming to a certain degree, but clojure is a lot more powerful when it comes to language extensions.
Threads as a library (for js environments) for clojure. https://github.com/clojure/core.async
Logic programming for clojure. https://github.com/clojure/core.logic
Declarative UI building, with dataflow semantics. http://reagent-project.github.io
Additionally immutability makes your life a lot easier. Parallel computing in clojure is a no brainer, you just change your map to pmap, and that's it.