Live data from Hacker News

Clojure by Example (2015)

kimh.github.io

21–30 of 46 posts

Re: Clojure by Example (2015)

#21
post #18
post #6

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 som…

Are 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'?

I 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/

Re: Clojure by Example (2015)

#22
This is my way of learning too. I certainly dont have a patience to read the docs, official guide before i start. Just hacking directly through repl and getting to know primitive data types, constructs and most commonly needed APIs functions is the most practical way IMHO.

Of most of the books written on clojure i really like "Living Clojure" by Carin Meier. Throughout this book, she will give you the feeling that she is sitting beside you and you pair programming with a senior clojure developer. She goes very elegantly into each topic through actual examples and necessary commentary.

Highly recommend this book :- https://www.oreilly.com/library/view/living-clojure/97814919...

Re: Clojure by Example (2015)

#23
post #11

The language isn't what's difficult to grasp or what needs more explanation. What's missing is current complete examples with the library choices and configuration all worked out.

I'm not sure if this is enough, but I wrote these [0][1] a while ago and if they're not to your taste, I do admit to a fairly offbeat writing style, there's also Luminus[2] and re-frame[3].

They may not be complete enough for your tastes?

I definitely can sympathise with the ecosystem being complex to get into =)...

Take Fathom which I walk through a small fraction of in [0] and [1], there's a lot there. It's being actively worked on and there's a lot of docs to go through. That said Clojure's communities are pretty friendly, you can get pretty far by just finding some example projects, tinkering with them and asking questions =)...

- [0]: https://folcon.github.io/post/fulcro-basics/2020-05-12-Fulcr...

- [1]: https://folcon.github.io/post/fulcro-basics/2020-05-26-Sprin...

- [2]: https://luminusweb.com/docs/guestbook

- [3]: https://purelyfunctional.tv/guide/re-frame-building-blocks/

Re: Clojure by Example (2015)

#24
post #18
post #6

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 som…

Are 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'?

Rich Hickey has a good number of talks on YouTube that explain the thinking behind Clojure's language design

Re: Clojure by Example (2015)

#26
post #18
post #6

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 som…

Are 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'?

Programming 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.

Re: Clojure by Example (2015)

#27
post #5

> Clojure doesn't provide built-in function for exponential operation It does actually: (Math/pow 2 3) ;;=> 8

`Math/pow` is not a function. If it were, you would be able to do things like this:

    (map (partial Math/pow 2) [0 1 2 3])

Re: Clojure by Example (2015)

#28
Personally I've had great success working slowly with an open babashka repl through the tutorials from aphyr: https://aphyr.com/tags/Clojure-from-the-ground-up - everything else didn't really stick for me, but I probably didn't invest enough time. Especially the first few articles helped a lot to clear up misconceptions for a newbie to lisp. I remember reading the linked article but it didn't worked for me.

Re: Clojure by Example (2015)

#29
post #6

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 som…

In 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.

Re: Clojure by Example (2015)

#30
post #18
post #6

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 som…

Are 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'?

If 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.
Post reply on HN