4 ms·
> Clojure, in fact is quite easy to grasp - especially for someone coming from Java I disagree on that point. In my experience as a programming language teache
by cygned 7y ago
> Clojure, in fact is quite easy to grasp - especially for someone coming from Java
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.
- adz5a 7y agoHello, this is an interesting take. Clojure has been a hobby of mine for some time but now I am a professional Clojure developper (clj/cljs). I knew the language before starting my new job but I found it really different than know the "platform": how a project is layed out, tests are written, some libs, how to pinpoint potential technical debt/suboptimal code accurately and so on... But I guess this would have been true if I had transition to any other new language. 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 :)
- eecc 7y agoHey, once you get over accepting a = a+1; without gagging it’s all downhill from there ;)
- kazinator 7y ago> even more to learn a Lisp, especially if they are used to a C-like language 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 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.