4 ms·
Learning a new language by mapping constructs from another language you know better is certainly expedient. But the trade off is you short change yourself on l
by mapgrep 5y ago
Learning a new language by mapping constructs from another language you know better is certainly expedient.
But the trade off is you short change yourself on learning core philosophical beliefs underpinning the design of the language. Understanding these poorly means you will not exploit the language very well and arguably should just stick with the prior language.
Clojure more than most languages is built around some unconventional philosophical beliefs. So for example “reduce” becomes more than just another sequence function; in clojure it is an important way to build up a result in the absence of mutable variables (which in another language you could use to build up a result within an arbitrary type of loop). You really don’t get that from reading this cheat sheet. But if you took some time to read a slower introduction this will be made clear (“reduce” is prominent in Clojure for the Brave and True for example).
Similarly recursion becomes much more important in clojure due this same constraint.
As a lisp, clojure offers the opportunity to use macros, which come with tremendous power but also some important gotchas. You won’t get much here on when to use and not use macros, just a quick walkthrough of defmacro and friends.
I could go on. Clojure’s powerful concurrency primitives, its a-la-carte approach to polymorphism and inheritance, its emphasis on plain maps — all these types of things warrant a deeper rethinking of how you solve programming problems which you’re not going to get by just diving in (rushing in really) to some coding.
I’m not trying to knock this guide, it’s fine, but it does show the limits of the very approach it celebrates. It’s fine if you’re jumping from say python to ruby or Java to C# but Clojure would be near the bottom of the list of languages to learn this way.
- avtar 5y agoAre there any other resources that you'd recommend to people coming from languages like Python or JavaScript? I'm assuming 'Clojure for the Brave and True'?
- zdkl 5y agoI second the Brave and True book to get your feet wet and add this website to get a better grasp on where/what/how to use the different elements of Clojure, with examples. Especially the "see also" section which will point you to functions you may not have heard of otherwise. https://clojuredocs.org/ https://clojuredocs.org/
- slifin 5y agoRich Hickey has a good number of talks on YouTube that explain the thinking behind Clojure's language design
- Kototama 5y agoProgramming Clojure (The Pragmatic Programmers), will get you there. Also Clojure Programing (O'Reilly) is also good, a bit longer. Clojure requires a mental shift but it's not Haskell neither, you can be extremely productive after a few months.
- kubb 5y agoIf you're more of a learning by doing person, you can try to solve the problems in the Clojure track at exercism.io and compare your solutions with highly rated solutions of others.
- bear8642 5y agoFound walking through exercises of Clojure Koans useful
- gengstrand 5y agoI maintain a github repo where I implement the same feature identical rudimentary news feed microservice in different programming languages and frameworks. Here is the social broadcast function in clojure. https://github.com/gengstrand/clojure-news-feed/blob/master/server/feed13/src/feed/services/outbound.clj#L11-L21 https://github.com/gengstrand/clojure-news-feed/blob/master/... and in python https://github.com/gengstrand/clojure-news-feed/blob/master/server/feed5/swagger_server/services/outbound_service.py#L26-L43 https://github.com/gengstrand/clojure-news-feed/blob/master/... and in node.js javascript https://github.com/gengstrand/clojure-news-feed/blob/master/server/feed4/services/OutboundService.js#L5-L49 https://github.com/gengstrand/clojure-news-feed/blob/master/... That last one is pretty old and predates async and await.
- jetti 5y agoAt work we would give new hires "Living Clojure". There is also the site https://www.4clojure.com/ https://www.4clojure.com/ if you are looking to do some exercises.
- vipermark7 5y agoIf you're comfortable sharing, where do you work that uses Clojure? I'm still a bit junior myself (Java dev), but I've been interested in FP and especially LISP for a while
- jetti 5y agoI'm sorry but I am not comfortable sharing, however, here is a list of companies that I know use Clojure. - Arena Analytics: https://arena.io/ https://arena.io/ - Reify Health: https://www.reifyhealth.com/ https://www.reifyhealth.com/ - Guaranteed Rate: https://www.rate.com/ https://www.rate.com/ - OppLoans: https://www.opploans.com/ https://www.opploans.com/ - LookingGlass Cyber Solutions: https://lookingglasscyber.com/ https://lookingglasscyber.com/ I also believe that DRW (https://drw.com/ https://drw.com/) also use Clojure but not 100% sure on that. I know they use some Elixir though.
- mapgrep 5y agoYes, I came from python and ruby and that book helped me a lot. You can read or free on the website, I also bought the Apple Books version. I’d second the person who suggested watching some Rich Hickey talks on YouTube, or at least trying one and seeing if it agrees with you (that is, don’t force it if you’re miserable 10m in but I find him a compelling speaker and others seem to as well). In descending order of preference I’d suggest (all are on YouTube): - Effective Programs - 10 years of clojure (great overview of overall thinking behind clojure, touches a lot of key points, and a fun talk) -Are We There Yet - this one resonated with me but not in most people’s top lists it would seem - a head on critique of OOP and dive into what makes functional and Clojure in particular better -Simple Made Easy 2011 (there’s a 2012 where the audience is kind of a drag) - one of his most popular, his vision of what simplicity really means and how to achieve it in code -the value of values - deep dive on clojures data philosophy
- d_t_w 5y agoIn my experience I found the ability to produce a similar functional deliverable (e.g. a webservice or similar) in Clojure as I was able to in my previous language (Java) was the most important factor in my learning and continuing with Clojure. Guides like this give a quick-start into that world. The book-driven big-philosophy route might work better for some people, but to take your first example of "reduce" being special - well that's never really occurred to me as important or remarkable. In time Clojure has transformed how I program computers, so the big ideas have settled in. I've never finished a Clojure book so I can't offer much reportage on their effectiveness. We all learn differently, I guess that's the point.