
Show HN: Easy intro book to Clojure and immutability - viebel
https://www.getprogrammingwithclojure.com/
======
mbace
"It's user-hostile, why did you think this was a good idea?" I'm Manning's
Publisher and I thought it was a good idea. We obviously implemented it badly
if you guys think it is "hostile." Also, we have failed to explain WHY it's
done this way: by getting scrambled content first and unscrambling as you
scroll you are able to look at any piece of the book that you choose--you're
not forced to look at the one or two chapters selected by the publisher and
offered for free. The mechanism allows that without giving away the entire
content for free. If you do look at it in scrambled form, you still get a
sense of what it covers because much of it remains unscrambled: the heads of
all levels, all code, all figures and code, and figure/code comments and
captions.

After seeing this discussion we changed the unscrambling animation--it's not a
rotation anymore but simply a replacement. Let us know. Also, the amount of
time we let people read unscrambled content is limited. Maybe it needs to be
longer?

We keep trying ideas that we hope will please our readers; sometimes we are
going to fail.

------
viebel
This book is my attempt to make Clojure more accessible for newcomers. The
book teaches at a digestible pace the syntax and the main concepts of the
language, in particular data immutability which is at the core of the
language.

This is part of a "Get Programming" series by Manning, which means that the
reader is guided from concrete to abstract until the ideas are fully
integrated.

This book takes a pragmatic down to earth approach:

\- Lots of code snippets in each Lesson

\- Several exercises at the end of each Lesson

\- A Capstone Project at the end of each Unit

The book is in MEAP (Manning Early Access Program) stage which means that for
now only the digital version is available and 5 out of 16 Units are published.
(When a new Unit is published, the reader gets notified.)

Hopefully you'd find interest in this book whether you are a Clojure beginner
and want to learn the basics of Clojure in a structured way or a Clojure
experienced developer and want to help your friends or teammates in their
Clojure journey.

I am very interested in hearing comments (in particular improvement
suggestions) both about the approach and the realisation.

~~~
tomcam
I wish it took a pragmatic down-to-earth approach to presenting information,
considering it’s illegible.

~~~
viebel
What would be, in your opinion, a down-to-earth approach to presenting
information?

~~~
kranner
Not GP, but a PDF excerpt on your website works for most people. In this case
if Manning will allow it.

~~~
viebel
Manning allowed me to provide in pdf the Unit 0 and Unit 1. Unit 0:
[https://docs.wixstatic.com/ugd/8165fc_091580b11bc742c8830d29...](https://docs.wixstatic.com/ugd/8165fc_091580b11bc742c8830d29b8ebe6eac7.pdf)

Unit 1:
[https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c...](https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c290353966e.pdf)

~~~
kranner
Great!

------
ghubbard
I stopped reading because the letters kept "unlocking" and rotating in an
annoying way. There are other less user-hostile Clojure guides.

~~~
viebel
Manning allowed me to provide in pdf the Unit 0 and Unit 1. Unit 0:
[https://docs.wixstatic.com/ugd/8165fc_091580b11bc742c8830d29...](https://docs.wixstatic.com/ugd/8165fc_091580b11bc742c8830d29b8ebe6eac7.pdf)

Unit 1:
[https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c...](https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c290353966e.pdf)

------
sansnomme
One missing link (or unfilled need) in Clojure books is a strong, robust guide
on dealing with JVM's ecosystem and its associated shenanigans.

A guide is needed for interfacing with Java beyond simple method to dot
notation interop that only works for the simplest of cases and only with well
designed libraries that exposes clean APIs. Most significant projects in Java
are built as massive frameworks with all sorts of weird tooling and
dependencies. E.g. Minecraft Forge, Android Dalvik. Clojure has this 'small
libraries good, big frameworks bad' mentality and expects everyone to be of
high calibre software developers. You have to start somewhere and if you are
not an Java developer experienced in wrangling with JVM intricacies then
anything _interesting_ can't be done with Clojure. You have to spend weeks on
the IRC and mailing lists in the hopes of finding someone who either cares to
help you with your problem or just builds the bindings for you. The company
driving Clojure development (Cognitect) is small so I suppose their hands-off
approach can be excused. But the community really need to pick up the slack
for users coming to Clojure who are not experienced Java Devs. E.g.
Go/C++/Common Lisp developers who wants to integrate a application written in
JRuby and built with a custom Groovy Gradle build script with Clojure. For
Java this is very common use case since it's the lowest denominator in the
JVM. But good luck for Clojure. There is a huge need for a good book on this.
Most Clojure books are generally: how to reinvent a web framework, 101 ways to
process a text file using Clojure concurrency features and sequences with a
dose of functional programming.

Clojure's error messages (or JVM stack traces for better or worse) are
infamously terrible compared to similarly "hip" languages like Elm and Rust
that have wonderful error messages. (Version 1.10 improved on this area though
there's still plenty of room to grow to reach Rust-level of developer UX) It
would also be nice to let users know early on when starting to use the
language that Clojure libraries needs minimal maintenance and are almost
always completely reverse compatible. (Whether this really is good practice or
not when most large software projects are 'evergreen' with 'living
documentation' is besides the point. A white lie to users won't hurt anyone.
It would be terrible if a person reading a blog post on constraint solving in
Core.Logic realizes it hasn't seen a major update in 3 years, gives up on
Clojure, and ends up using miniKanren in Python instead.)

~~~
dragandj
So a sort of "Learn JVM (with Clojure)" book?

I myself would be interested in writing something like this, but I am not sure
that enough people would want to buy that? Would YOU buy that book if it was
available today?

~~~
bsg75
I would definitely buy this book. With so many things that leverage the JVM,
and with new things like GraalVM, learning the JVM ecosystem from the
perspective of a non-Java developer would be very useful.

------
wry_discontent
Maybe it's just me, but what I've found most difficult about clojure isn't the
language itself, it's the java ecosystem around it. I found clojurescript to
be much easier to start working with, and I can only assume it's the
javascript backend.

Did anybody else have a similar experience?

~~~
lame88
In my brief experience (so take my opinion with a grain of salt), it's the
Clojure ecosystem around Clojure that is the problem, not the Java one it
interops with. There is hardly any unification for anything except that it
looks like Ring is the main HTTP lib (just for http; beyond that, how many
routing libraries are there now?), and edit: there is a lot of library churn
that goes with that, which to me totally conflicts with the language's
reputation for being evolutionary and stable. Most libraries I have seen are
written and maintained by a single author. 50% or so of the libraries I have
seen are just plain dead questionably dead, including stuff written by
Cognitect. It's not a healthy situation. It's a shame, because the language
itself is awesome.

------
backpackway
While I am big fan of Clojure and even more ClojureScript...

The problem is: Once an ecosystem is stagnating or on the decline it's a huge
risk to enter this space. It's not just your own market value you might be
destroying, it's hard to find resources and to scale development.

Besides this, what I really want is strong competition between lib authors in
order to keep the ecosystem evolving. Even current blockbusters like React
face problems in this regard, like the react-router monopoly where maintainer
Michael Jackson buys competitors from the market to keep his leadgen machine
running. I know this is OT but a language without a huge OR trending ecosystem
is worthless.

~~~
jeff_friesen
I think what you are stating is that the Clojure ecosystem is stagnating. I'm
moving more and more of our company's stack over to the Clojure ecosystem
because I see a lot of innovation and excitement in it. More importantly, it
takes fewer people to be more productive in it.

I know some high-profile people have left the language for various reasons,
but there are lots of people I know personally who are joining it. We should
expect some churn.

I won't try to convince you that it isn't stagnating, but I want to put out an
alternate perspective from someone who is investing a lot in the ecosystem.

------
twoquestions
Is Clojure still getting used in non-legacy environments?

I understand it was never meant to supplant Java or C#, but I tried to look up
how to set up tooling and most of what I found was very out of date.

~~~
didibus
It very much is, and growing, albeit slowly.

My team uses it almost exclusively. I know Walmart uses it a lot, they even
maintain a GraphQL open source framework for it. There's other medium to small
shops that are either using it or exclusively using it.

I'm trying to publish new guides on my blog. So I'm interested in the out of
date setup you found. Can you link to some, it would be nice to see what kind
of content you were looking for and if I can put out an updated version.
Cheers!

~~~
twoquestions
The 'Try it online' link on ClojureScript's Github page is broken, not sure if
that service is still online.
[https://github.com/clojure/clojurescript](https://github.com/clojure/clojurescript)

The Tools page under ClojureScript site doesn't mention Sublime Text 3 or VS
Code at all (in typing this I realize Emacs would probably be the most common
editor while working with a lisp like Clojure...).
[https://clojurescript.org/tools/repls](https://clojurescript.org/tools/repls)

LightTable hasn't been updated in forever, but they're cognizant of that and
are working on it.

Clojure on Windows is apparently still in alpha state. Out of curiosity, do
you work on Mac or Linux?
[https://github.com/clojure/tools.deps.alpha/wiki/clj-on-
Wind...](https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows)

The repl.it Clojure instance is very old, but that's not unique to Clojure.

Clojure looks to be a very good language, and I enjoyed playing with it a few
years ago, and I understand it's improved a lot since then, especially in
error handling, which is why I bounced off back then. I was just worried it
was more like Objective-C (an apparently declining language with a clear
successor) than Rust (a small but passionate community). Good to hear it's
still going strong!

~~~
Scarbutt
To play with cljs online you want this one:
[http://app.klipse.tech/](http://app.klipse.tech/)

Which is made by the author of book. The link was under
[https://clojurescript.org/community/resources](https://clojurescript.org/community/resources).

~~~
twoquestions
Thanks!

------
revskill
I'm wondering, since the explosion of Javascript frameworks, is there any
staistics about how many backend devs move away from their stack into the JS
stack ?

What and why they move then ? What they value ?

Beauty vs pragmatism ?

Pure static typing vs gradual typing ?

Pure backend vs universal stack ?

~~~
yogthos
Once nice thing with Clojure is that it targets both the JVM and Js runtimes.
All the devs on my team work on full stack, because we don't really see the
separation. It's the same language, same tooling, and often same libraries.

On top of that, Clojure ecosystem is a lot more stable than Js. Library APIs
don't keep randomly changing, there isn't an explosion of frameworks. My team
has been using Reagent/re-frame for the past 4 years, and it just works.
Whenever a new version comes out we just bump up the dependency.

What's more interesting is that Reagent is built on top of React, and React
itself went through many breaking changes over the years. Yet, Reagent API
remained stable throughout that time. I think that's a testament to how well
it was designed from the start.

~~~
viebel
I completly agree with yoghtos. One of the main reasons, Clojure is not as
famous as it could be in the developer community, because it has a reputation
of a language that is hard to learn. I hope that my book will attract many
non-Clojure devs inside our wonderful Clojure community.

~~~
passthejoe
How soon before you release more chapters?

------
vikeri
Congrats on the book Yehonathan! I remember meeting you at ClojuTre some years
ago, nice to see you're keeping up the good work!

~~~
viebel
Hopefully we'll meet again this year at ClojuTRE. I have submitted a talk.

------
hoveractive
How is this trending on Show HN? The text is unreadable. The letters lock,
unlock and rotate. Can there be a more user hostile way of offering a free
preview?

From the Show HN guidelines:

> If your work isn't ready for people to try out yet, please don't do a Show
> HN.

There is clearly no way to try out this book. The "Show HN:" prefix should be
removed from the title so that this post can belong to the list of regular
posts.

~~~
dang
As far as I can tell the gibberish text eventually becomes readable. So the
book exists and can be tried out, but with some annoyance. That still
qualifies for Show HN. For books, people usually put a free chapter or two up,
which is arguably less annoying, but there is room for different approaches.

The intention of the "try out" guideline is to make sure that the work
actually exists and that people can play with it to get an idea of what's
there. It's not intended to force Show HN projects to all be free.

[https://news.ycombinator.com/showhn.html](https://news.ycombinator.com/showhn.html)

------
joosters
An obvious improvement would be to show the actual text of the book on the web
pages, instead of showing gobbledygook and then (eventually) triggering a
pointless animation that converts the mess into the real words.

It's user-hostile, why did you think this was a good idea?

~~~
viebel
It's the way manning sells the books. If you want to read quietly, you have to
purchase the book

~~~
joosters
I have no problem about people selling books. Put free snippets of the book
(or the whole thing) online, or don't. Either is fine. But putting the text
online and making it hard to read is just stupid.

~~~
dragandj
While I agree with you, it's worth pointing out that the author (viebel) has
no say in how the publisher distributes free samples. It is simply a given,
they don't ask, and the only thing that the author can do about it is to
publish with someone else.

When you self publish, that aspect is easier. You simply do what you think is
best, listen to the audience, and make it better whenever possible. Now I'll
shamelessly put a link to samples of _my_ Clojure book here. It is not
competing with the OP's Clojure book, since mine is about Deep Learning and
high performance computing. I simply put several chapters as PDFs for free,
and if you like it, you can subscribe to the whole book (still a WIP, so you
get drafts as they are written).

[https://aiprobook.com/deep-learning-for-
programmers/#downloa...](https://aiprobook.com/deep-learning-for-
programmers/#download)

Of course, this requires manual maintenance, something that I can do, but is
too much hassle for big publishers that have to deal with many books and even
more readers at the same time.

~~~
jonahbenton
Congrats on your book, your work in the space is inspiring.

~~~
dragandj
Thank you.

