I disagree on that point. In my experience as a programming language teacher, people often struggle to learn functional programming and even more to learn a Lisp, especially if they are used to a C-like language. And learning both at the same time is even more difficult. I liked working with Clojure but I have yet to meet someone who easily grasps the language and - more important - development patterns.
Would you have any example of what your trainees stumbled upon or found difficult in the language? That would be useful I guess when we try to onboard new people on the project.
Have a nice day :)
Ah, you're mixing up Clojure and Lisp. The restrictions in Clojure have nothing to do with Lisp tradition.
Someone used to a Lisp-like language will also struggle with Clojure.
Traditional Lisps like Common Lisp are multi-paradigm languages in which variables and most aggregate types are mutable.
They are not hard to pick up for someone with a background in C.
C has pass-by-value functions; so does proper, traditional Lisp.
C has mutable variables, arrays and structures; so does Lisp. Lisp data structures like lists or hash tables are easily understandable by a C programmer with a good background in data structures.
cons is like malloc-ing and filling-in a two-field struct, except that freeing is taken care of.
People have written Lisp systems in C (and written more than one book on that exact subject: Nils M. Holm just put a new one out: http://www.t3x.org/lsi/index.html), with a lot of the internals being written in C over the Lisp library functions. E.g. visiting and printing the elements of a list can literally look like this, in the internals of a C-based Lisp implementation:
for (val iter = list; list; list = cdr(list))
print(car(list));
val is some typedef for a pointer to a "struct lisp_object" or whatever. The nil value is represented by null, and so it goes.No, many more people know Java than Clojure, that's it. Whether it's the right decision for the future of the project, time will show, but I don't think it was taken lightly.
I still see people writing
for(i = 0; i < something; i++) {
}
Java could get cleaner, but habits die/change when programmers retire not when Java makes new releases.Meanwhile, I've successfully contributed to plenty of Clojure libraries I use, and many people contribute to my projects. Clojure code is far more direct and concise making it much easier to understand the intent. And majority of the code is written using pure functions that can be reasoned about in isolation. On top of that you have an editor integrated REPL, so you can just run any code you're not sure about as you're reading it.