
Clojure Newbie Guide (2015) - sriharis
http://www.clojurenewbieguide.com/
======
manishsharan
I have been a Clojure newbie for over 3 years now and here is why I am still
using it:

1\. Clojure code makes sense to me : I could go back to Clojure code someone
wrote three years ago and I would have no problem in figuring out what the
code was doing. With Java or Javascript, unless the code is documented with
extreme diligence, the nuance are hard to decipher.

2\. REPL based coding makes it easy to get code right before making it part of
my namespace

3\. lack of strong typing has not been a stopper for me yet. Spec is good
enough for my needs

4\. State and concurrency : Its hard to screw up concurrency and state
mutation with Clojure

edit: formatting

~~~
wry_discontent
What're you using it for? I really like the language, but it seems geared to
replace Java for heavy enterprise enterprise applications. A lot of the
benefits I hear people talk about sound like they require a large project to
be properly noticed.

I've used Clojurescript for a couple toy projects, but it seems awkward to me.

~~~
didibus
Clojure is good for everything you'd use Java for. So pretty much anything
that's going to be long running, like services, or big apps meant to be open
for a while. Yes, that fits the enterprise use case perfectly. A backend for
any service oriented architecture, ETL jobs, data processing pipelines,
backend for websites, rest/rpc/graphql services, client/server applications,
big data analysis, machine learning, etc.

Clojure is not good for quick scripts, use bash, python, perl, hy,
clojurescript, etc. for that.

Clojure is not good for low level code, like drivers, embedded systems, os,
etc. Use rust, c, c++, D, etc. instead.

Clojure isn't good for squeezing every ounce of power out of hardware, such as
games, use C++, assembly, etc. for that.

Clojure isn't good for mobile app development, use Java, swift, c#,
objective-c, etc. for that.

Clojure isn't good as an embedded scripting language, use LUA, python,
javascript, tcl, scheme, etc. instead for that.

Therefore Clojure competes mostly against Java, Scala, C#, F#, GO, NIM,
Haskell, etc. Now as an astute reader, you've noticed how none of the
competing languages I've listed are dynamic or of the lisp family. This makes
Clojure unique in its space and the most controversial.

~~~
heftyfive
I agreed with most of your comment, but not the end.

I don't think Clojure competes with Go or Nim. And Clojure seems to be the
antithesis of Haskell. Clojure competes with Java, Kotlin, Scala, and C# if
you're on an MS platform.

I used Clojure for pet projects for a while (it's a gorgeous language) but
eventually went back to Python because I wanted something with:

* easier interop with C/native libraries,

* faster startup (though for _scripts_ , [inlein]([http://inlein.org/](http://inlein.org/)) mitigates this issue)

* no requirement of the JVM

* better error messages / more help finding my bugs

* smaller memory and cpu footprint

Looked at some Schemes (Chicken), but couldn't stomach the car/cdr/dotted-pair
stuff after having nice data structures like in Clojure, Python, et al. Not
interested in ClojureScript, as I don't want JS underneath. Still prefer
Clojure-the-language to Python-the-language, but here we are.

~~~
didibus
Why wouldn't Clojure compete with go or nim?

Go and Nim are both mostly used for backend services, long running processes
deployed inside docker instances, etc.

I agree it competes a little less then it does against Java, C#, et all. But
it still does, in that there's overlap for what projects they'd be good
candidate for.

------
georgewsinger
Here are the reasons I stopped using clojure (a phenomenal language) a year
ago, in order of importance:

1\. No C/C++ FFI.

2\. Lack of a strong type system (clojure.spec almost solves this problem now,
but when I quit this didn't exist yet).

3\. Horrific startup times: although clojure itself is fast, its startup time
isn't. This makes scripting in clojure unsatisfying. And you don't feel like a
ninja when it takes 30 seconds to start a REPL. You can use clojurescript to
target node to get around this, but then you cut yourself off to most of the
powerhouse clojure libraries.

I now use Haskell (with C/C++ FFI). I do miss the homoiconicity (and slightly
more concise syntax) of clojure. In my opinion Haskell and clojure are the two
sexiest mainstream languages that you can get stuff done in.

~~~
flavio81
If in any case you still feel the same about Clojure, you should try Common
Lisp, it has the three things you want:

1\. Easy calls to C with CFFI. No Clojure->Java->JNI->C, just straght CL->C.

2\. Useful, optional, type system (which can also catch mistakes at compile
time with SBCL and other compilers)

3\. Very fast startup times.

and _many_ more features like for example an object system that is massively
above what Clojure and Java bring to the table, better exception handling,
very explícit errors and nice stack traces, it can also compile to JVM if you
want, etc.

If you like Lisp, try it. You already learned a Lisp so the jump is easy.

~~~
peatmoss
Chiming in to give Racket a shout out. Good FFI, good libraries, good tooling,
good community, good (soon to get even better) performance, subjectively more
modern feel than CL, great type story via Typed Racket.

~~~
dTal
>(soon to get even better) performance

Why? Are the rumours of porting the language to Chez Scheme true?

~~~
peatmoss
I hope it's not just a rumor!
[https://news.ycombinator.com/item?id=13656397](https://news.ycombinator.com/item?id=13656397)

------
flavio81
Happy to see there are good learning resources for Clojure.

The more Clojure users out there, the better, since it is a Lisp language, and
as more people learn and use Lisp, it will be more easy for them to also able
to also use Scheme, Racket, Common Lisp, LFE and the other friends in the
illustrious Lisp family.

This, in the same way people can easily learn C, Java, C++, Rust, by knowing
just one of those four languages. Once you understand the syntax, it gets
really easy.

------
amk_
Does anyone use Clojurescript as a webapp backend instead of Clojure?

~~~
iammiles
Not sure if anyone is using it, but there is this: [https://macchiato-
framework.github.io/](https://macchiato-framework.github.io/)

