Clojure for the Brave and True by Daniel Higginbotham is a truly great resource to learn Clojure. I highly recommend it. It is also free online [0]. [0]: https://www.braveclojure.com/clojure-for-the-brave-and-true
Try Clojure
261–270 of 404 posts
Re: Try Clojure
#262the best reason to learn clojure is reagent[1], by far the best way to use react. shadow-cljs[2] makes using npm libraries easy. i’ve settled on go backends and reagent frontends as my default setup[3]. 1. https://reagent-project.github.io/ 2. https://github.com/thheller/shadow-cljs 3. https://github.com/nathants/aws-gocljs
Re: Try Clojure
#263Earlier quoted context omitted.
I'd take the verbosity over having to count the operators from the start of the line to figure out which one are used at the end of the line "1.5 2"
The parenthesis highlight in any decent editor. So it always very obvious which operators apply to the operands.
The threads example in another comment is way better
Re: Try Clojure
#264Earlier quoted context omitted.
Along the same lines with the docs, I also find it frustrating that a lot of the very most core basic abstractions and interfaces are left totally undefined in terms of documentation. Take `ISeq`'s definition. Surely, a candidate for the single most core interface. https://github.com/clojure/clojure/blob/master/src/jvm/cloju... But like, where is the javadoc? What exactly is supposed to be the contract of these metho…
You don’t use the ISeq interface directly, you use them through the clojure.core API. The seq abstraction is documented at https://clojure.org/reference/sequences
Re: Try Clojure
#265The problem I see with clojure, isn't it missing autocompletes? You work with JVM/typescript libraries, but your editor isn't smart enough to pull types from those into clojure. That slows you down tremendously.
If you need method autocomplete scoped to a type you can use the `..` macro for more concise call syntax:
(ns my-project.core
(:import (java.util ArrayList Collections)))
(defn example []
(let [list (ArrayList.)] ; ArrayList constructor can be autocompleted
(.. list
(add "Hello") ; The .add method on ArrayLists will be autocompleted
(add "World")
(add "Clojure"))
(Collections/sort list) ; The Collections.sort method will be autocompleted
list))
this other form will a also autocomplete everything after the dot (.) to call a method on an object: (.toUpperCase some-str)
but the trick with this arrangement is to write that variable some-str first, then if you write . in front of it the autocompletes will be relevant to that object. But I gratuitously used threading macros like .. or -> to make it match java-style code (in other words: (-> some-str (.toUpperCase))).Re: Try Clojure
#266I'm glad this is back. A version of this existed in the ancient past and helped encourage me to try Clojure which ended up being by far the most impactful decision in my professional life. It went away for a while for reasons I'm unclear on. I use Clojure nearly daily at my job and at home. Sometimes it's standard Clojure, sometimes it's the excellent Babashka flavor which I use as a make-like task runner and Zsh-lik…
The "j" is always what put me off from learning Clojure. I've had too many bad experiences with JDKs and JVMs that I stay a thousand kilometers away from any thing that has "J" in it unless it's referring to JavaScript.
It's pretty easy to switch to writing JVM Clojure if you're familiar with Babashka. Most of the libraries written for Babashka are designed to work in either environment.
That said, there are reasons you may want to use the Clojure on the JVM later on. It might be interesting to read the replies to another poster with similar concerns about the JVM: https://news.ycombinator.com/item?id=40445415
Re: Try Clojure
#267The problem I see with clojure, isn't it missing autocompletes? You work with JVM/typescript libraries, but your editor isn't smart enough to pull types from those into clojure. That slows you down tremendously.
Re: Try Clojure
#268I still remember Professor Brian Harvey rolling out his terminal on a cart in Berkeley's CS61A and typing out commands in a scheme repl. Learning what a y-combinator was with Structure and Interpretation of Computer Programs, and building my own scheme compiler with scheme.
Re: Try Clojure
#269the best reason to learn clojure is reagent[1], by far the best way to use react. shadow-cljs[2] makes using npm libraries easy. i’ve settled on go backends and reagent frontends as my default setup[3]. 1. https://reagent-project.github.io/ 2. https://github.com/thheller/shadow-cljs 3. https://github.com/nathants/aws-gocljs
Re: Try Clojure
#270Earlier quoted context omitted.
YMMV. I always found it very welcoming and full of interesting people.
I may be wrong, but I think the parent poster was talking more about the language and ecosystem than the community. I, too, have found the community to be amazing. But the language itself used to be quite frustrating to learn. It's better now, but I think that by the time it got fixed many companies and teams had already been burned. Clojure is particularly vulnerable to that because it really is an enterprise applic…