> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.
(reference to: https://www.destroyallsoftware.com/talks/wat)
51–60 of 404 posts
> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.
(reference to: https://www.destroyallsoftware.com/talks/wat)
That's a great introduction, but... how to do an if statement would've been cool to add in the tutorial.
(if (= 2 2) :OK :nope)
Earlier quoted context omitted.
In my experience, the subsets of the community around clojure were one of the biggest problem with it. It's gotten better over the years, but circa 2016 - 2018 it had a spike in popularity despite being very hostile to newcomers. There was an almost apologist attitude towards rough edges or failure modes folks new to the community would fall into. I managed to work with it for a time despite that, but it left me with…
> ...had a spike in popularity despite being very hostile to newcomers. To be fair the community itself, as humans, was very welcoming to newcomers. Really super nice and helpful folks. If anything was "hostile" it was the dominance of emacs and very limited options for other tooling. That, and the horrifically unhelpful leaky abstractions in the stack trace when something went wrong. It's a big step, if you don't al…
> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.
If you try that in Clojure, you'll get:
> ClassCastException class clojure.lang.PersistentList cannot be cast to class java.lang.Number
If you try it in a "proper" ClojureScript dev environment (shadow-cljs), you get nil as a result with this warning:
> cljs.core/+, all arguments must be numbers, got [number cljs.core/IList] instead
Earlier quoted context omitted.
In my experience, the subsets of the community around clojure were one of the biggest problem with it. It's gotten better over the years, but circa 2016 - 2018 it had a spike in popularity despite being very hostile to newcomers. There was an almost apologist attitude towards rough edges or failure modes folks new to the community would fall into. I managed to work with it for a time despite that, but it left me with…
A somewhat similar thing I ran into is that existing Clojure code can be incredibly difficult to grok if you don't already know the language very well. Some of this comes from lisp's minimalist syntax, which makes it hard to even know what kind of thing you're looking at when you're encountering a new thing for the first time. But the problem is also compounded by some of Clojure's more distinctive (and powerful) fea…
Evidently, 93% paint splatters, when OCRed, are valid Perl programs:
https://www.mcmillen.dev/sigbovik/2019.pdf
I doubt that a similar thing is true for Clojure.
Here, the only problem is that you don't know what the symbols and some of the notations mean. You can look at the unfamiliar syntax and know what is a child of what. Most operators are words you can search for.
I love clojure, but it's really lost a lot of the momentum it had as many imperative languages have adopted parts of functional programming (and much for the better) over the last many years. On the other side I've felt a lot of the ecosystem work that was done has a more "timeless" quality. Coupled with java interop I haven't ever felt wanting when I do reach for it for some hobby projects I keep up with. One thing…
nailed it. I don't know much about functional languages other than a haskell course back in the day, but I don't want to do functional all the time. It plays great in some situations and I am happy to use those language subsets in my daily coding, but I don't need my entire application to be written in an esoteric language
It's a particularly good entry point because unlike full-JVM Clojure it has a very fast startup time. Newcomers can use any file-watching /reloading tools (e.g. nodemon) that they're already familiar with to work with it interactively.
Hopefully, a enthusiastic user will graduate to using a REPL connection in their editor for a fully interactive setup. But newcomers tend not to do this... its an unfamiliar workflow to most, and can be pretty cumbersome to setup.
[0]: https://babashka.org
> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.
> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.
Cool site, I've never tried Clojure before. My first reaction though is that (+ 1 1) is a highly unconventional and possibly confusing way of writing 1+1, and I'm not sure why that design choice came about.
The main one being if you want to add many many items together it's much easier IE (+ 1 2 3 4 5 6).
Instead of doing an operation between two numbers you are apply a function to a list of inputs. In the "+" function's case you are adding them together. With this in mind, it's no different than most other programming languages. You would never have your function be in the middle of your arguments/inputs.
In python its Foo(bar, bar) and not bar Foo() bar, which obviously doesn't make sense.