4 ms·
"As cemerick points out in another post here, Scala or Clojure (or Haskell or Erlang) will always have a "complexity" higher than VB or Java and that is fine."
by jimbokun 16y ago
"As cemerick points out in another post here, Scala or Clojure (or Haskell or Erlang) will always have a "complexity" higher than VB or Java and that is fine."
I find the complexity budget of Clojure much lower than Java, and maybe VB, too (haven't programmed VB in a long time).
In many ways, immutability by default, first class functions, and a library of higher order functions in the standard API make code much less complex with fewer concepts to understand than the corresponding Java code would be. The problem for many coming to Clojure is having to "unlearn" the "object oriented" Java concepts they already know (true for other functional languages, too, of course).
Clojure leaves type declarations completely optional. It does not try to assemble disparate programming paradigms and integrate them into a coherent whole. The built in data structures all implement the seq interface, so you can use the same functions on all of them.
Rich Hickey spent his complexity budget very well. I would rank Clojure with Scheme and Smalltalk in that regard.
- plinkplonk 16y ago"I find the complexity budget of Clojure much lower than Java, and maybe VB, too (haven't programmed VB in a long time)." I am not disputing that you find Clojure easier than Java but if you include complete mastery of macros and laziness and functional programming idioms into the "complexity budget" it is very arguable that some Joe Blow developer would find Java easier to learn and read and consider Clojure "too complex". I am just pointing out that they are bogus reasons to reject a language. The OP is claiming that the deep type theory constructs of Scala are too difficult for him. Of course they are, just as deep macro fu would be hard for a Clojure beginner. Please don't mistake me. I prefer Clojure to Java any day. I am reacting to the idea that "too many parantheses" or "but macros are too complex" or "laziness is too hard to wrap my head around" or "Scala has a more powerful type system than I am used to" or "Erlang has too weird a syntax" etc are sufficient reasons to reject them. Back to Clojure. My (original) point is that you don't need to understand macros (say) in all their glory before you build something in Clojure. Use a macro-less or macro-lite subset and grow into macros as you gain experience. Yes you will write less than the best Clojure for a while. (Imho) that is fine (and unavoidable). Rejecting Clojure because you couldn't completely understand macros (or read "complex" code with lots of macros) is (imo) not an optimal strategy.