r/Clojure • u/Muoniurn • Mar 08 '21
Is there a Clojure book that doesn't read like Soviet propaganda?
I've started reading The Joy of Closure and then the Clojure Programming book -- and while the former did start actually describing the language where I was, I just could not continue reading it with all the random references to blog posts as if they were some source of truth, and written as if they were some legit paper..
I don't have much experience with Lisps, but I did dabble with many different languages. I already decided to look more deeply into Clojure (I've done it once but only very briefly), in part because I want to experience this Lisp magic with macros. But I don't need a primer that functional programming is the holy grail throughout a whole chapter (because there is no objective evidence to that, even if some great blogger wrote a cool post about it -- and yeah, I do like it, but it is not a silver bullet for everything, as nothing is), nor that how cool is Clojure that it changed this and that from other Lisps. I'm already here reading, just get on with it...
Also, they usually have things like “it has actually less parens than the java version” with a very contrived example.. noone cares about the actual count of parens, it doesn’t cost money or something.. For those that have problems with the syntax it will not change their mind (though I find most criticism unfair regarding the syntax of almost any language), for others, they will just get used to it.. it sometimes feels like overcompensating. I’m fairly sure clojure can “stand up for itself” on merit without these bad examples, they only make a bad taste in one’s mouth.
Sorry for the shitpost, I do find the language a real gem based on my limited have at it, and I will continue on with the sidebar list until I find one that is at least remotely objectively-written. Also sorry for the authors, or those who did love these books - content-wise the first seemed okay, and if nothing else I will continue it, it's just the style
8
u/SimonGray Mar 09 '21
Clojure is pretty firmly in the functional Lisp camp, which puts it at odds with 99% of other languages out there. Some people do like that justified in some way.
I'm not sure what kind of evidence you feel like you need presented before you before anyone is allowed to say that functional programming is better than mainstream OOP. You seem think that any references need to be published as journal articles which is a strange objection to have IMO.
All programming languages are largely equivalent in what they can do, the differences are in how they map theory to reality through the language constructs. You can't "prove" that Clojure or functional programming is objectively better, but you can believe that it works better for you. If you think FP is unproven hype, then I think you picked the wrong Lisp.
2
u/Muoniurn Mar 09 '21
Clojure is pretty firmly in the functional Lisp camp, which puts it at odds with 99% of other languages out there. Some people do like that justified in some way
Even though the percentage is no longer true, I have no problem with justifying FP in a sane way. I’ve read both Scala and Haskell books that introduced people to FP and neither had such a paternalistic tone.
You seem think that any references need to be published as journal articles which is a strange objection to have IMO
No, I don’t think that at all. I just don’t think that it is healthy to state opinions as facts.
If you think FP is unproven hype, then I think you picked the wrong Lisp.
I have absolutely no objection to FP, Haskell is for example one of my favorite languages. But it is no silver bullet - it is absolutely the best abstraction for data manipulations, but there are problems it is not as suitable for as eg. the hated OOP. Though it is not on-topic, I want to learn clojure in-part because of FP.
Nonetheless, I agree with your other comment here and will continue reading JOC.
6
Mar 09 '21
I just don’t think that it is healthy to state opinions as facts.
... [FP] is absolutely the best abstraction for data manipulations ...
0
u/Muoniurn Mar 09 '21
Best abstraction compared to OOP.
My point was in terms of right tool for the right job, but thanks for taking it out of context. And before you call me a hypocrite, I am writing a comment, not a book.
6
u/SimonGray Mar 09 '21
Even though the percentage is no longer true, I have no problem with justifying FP in a sane way. I’ve read both Scala and Haskell books that introduced people to FP and neither had such a paternalistic tone.
I'm not just talking about FP, I'm talking specifically about the Venn diagram where FP and Lisp intersects. Scala and Haskell are quite different from Clojure, despite being FP. And so is Common Lisp. Try convincing the average Haskell user or Common Lisp user that Clojure is worth trying out.
I just don’t think that it is healthy to state opinions as facts.
The section that /u/joinr quoted in full was actually pretty well-sourced, which I think makes your hyperbolic assessment of it (Soviet propaganda) feel a bit like bait.
To me, it reads a lot like something between an essay and typical social science literature. I'm not sure what your academic background is, but in the social sciences there is really no such thing as "facts", it's pretty much just layers of conjecture all the way down and usually many different schools exist, all disagreeing with each other. This book just happens to be a school that likes dynamism, FP, and Lisp, so it builds the case for that particular path.
But it is no silver bullet - it is absolutely the best abstraction for data manipulations, but there are problems it is not as suitable for as eg. the hated OOP.
I don't think anyone is saying Clojure is a silver bullet, just that most of the OOP ceremony and hoops that Java make you jump through might be much ado about nothing. I dunno about you, but I personally spent several years learning to build proper Java stuff using the dreaded Gang of Four Design Patternstm and the thought of spending my life writing Java code made me consider going into teaching Chinese instead. Thankfully, I got into Clojure.
24
u/ws-ilazki Mar 09 '21
It's really old now, but the O'Reilly book, Clojure Programming, was the Clojure book I found most useful when learning it. Maybe because it's old and predates a lot of the hype, but it had none of the twee cutesy crap like Clojure for the Brave and True and I don't recall any Cult of Rich Hickey type material in it. Just a matter-of-fact introduction to Clojure and functional programming concepts, which is what I wanted when I was learning.
Unfortunately, due to age and lack of revised editions, a lot of it is less relevant or just plain wrong now, like old info about using leinengen and other tooling, or the focus on agents and refs (which don't work in ClojureScript and have since mostly been abandoned by Clojure users in favour of atoms and core.async instead, which do). Still, the first third or half of the book (approximately) remains a good resource for learning the basic language and concepts without any BS. Worth picking up a copy, assuming you can find one cheap enough to justify buying a fairly outdated programming book.
5
Mar 09 '21
I used it a lot after reading aforementioned preachy books and found it immensely useful. It's up front and the core content is basically the same. Get it on ebay.
4
u/dig1 Mar 09 '21
and have since mostly been abandoned by Clojure users in favour of atoms and core.async instead,
I'd say this is not entirely true. Both refs and agents have their place, but I'm getting the impression
core.asyncis frequently overused, giving the impression of simplicity that is a nightmare to debug.2
u/ws-ilazki Mar 09 '21
Both refs and agents have their place, but I'm getting the impression core.async is frequently overused
I agree on both points; they're both still useful and I especially found agents to be easy to understand and use, which was a big part of why I got interested in Clojure in the first place. However, they are largely abandoned by Clojure users now because they don't work in cljs and that has, like it or not, led to core.async being the de facto Clojure concurrency tool even when it's a poor fit for a specific job.
The book, on the other hand, was written before this shift happened, at the time when agents and refs and the easy concurrency they brought were considered the big selling point for the language, so it spends a lot more time on them than it likely would if it were up-to-date. Especially refs, which are amazing when you need them but the book was written at a time when people seemed to think you needed them for everything but since then atom supplanted them for most uses.
At first I thought the lack of refs and agents would be a temporary thing and something clever would be done to bring them to cljs; if not refs, at least to bring agents over using JS async or something. But that hope died after everyone including Rich hopped on the core.async hype train, leaving refs and agents still at the station, unloved and forgotten.
2
u/dig1 Mar 09 '21
like it or not, led to core.async being the de facto Clojure concurrency tool even when it's a poor fit for a specific job.
I'd like to see where it is touted as de facto concurrency tool for Clojure (by a reputable source, of course) :) Claiming these primitives are abandoned I'd consider as overstatement at least.
Clojure and ClojureScript are not exchangeable (one to one), so lack of refs/agents implementation in ClojureScript I don't see as a problem.
5
u/ws-ilazki Mar 09 '21
I'd like to see where it is touted as de facto concurrency tool for Clojure (by a reputable source, of course) :)
If it were touted as such by a reputable source it wouldn't be de facto now would it? I used that phrase for a specific reason, because it's the reality of core.async vs refs/agents now even if it hasn't been officially declared as such. For a while it seemed like everything I saw was suggesting core.async as the go-to option, not agents, because it works everywhere Clojure does and agents do not. Hence my claiming it's the de facto choice rather than suggesting refs and agents are deprecated.
Claiming these primitives are abandoned I'd consider as overstatement at least.
Abandoned by users. Languages tend to have features the users eventually shy away from (like how the Haskell community largely complains about things like the default Prelude and its string type and avoids them now) in favour of other parts of the language, and all I'm saying is that's what's happened here.
I'm not saying it's a bad feature that nobody should use, not saying it's been deprecated, just that the community as a whole seems to have moved away from the idea of agents and refs everywhere in favour of picking atoms and core.async first, and only using the other tools if absolutely necessary.
I don't particularly like it but that's the impression I've gotten from basically everyone everywhere. I think you and I are likely in the minority for liking agents.
3
u/pavelklavik Mar 09 '21
This book is great as a language reference for advanced Clojure programmers. I am writing Clojure and mostly ClojureScript professionally for 2 years and I sometimes open this book and learn something new. But I would not recommend it to newcomers to the language since it is too slow.
3
u/ws-ilazki Mar 10 '21
Really? It was the book that really helped me "get" Clojure's way of doing things, and is the one I actually feel like I learned Clojure by reading. I tried Clojure for the Brave and True first but it felt like there was too much fluff and not enough good explanation, whereas the O'Reilly book was more matter-of-fact and explained the how and why of things in a better way. Not as "fun" but more useful IMO, even as a newcomer.
2
u/pavelklavik Mar 10 '21
I didn't like Clojure for the Brave and True as much as well. But as a newcomer, I wanted to read something quickly and jump into coding. For that I don't really need a detail reference what are all special forms in Clojure, etc. I need a practical experience writing some code. I don't even remember what I read at the beginning. But of course everyone is different, so some people might prefer starting slower and reading O'Reilly book.
2
u/tuxbass Jul 21 '22
Oh god I've put down so many books because they're full of "jokes" that make me feel 2nd hand embarrassment and simply can't carry on.
1
u/reddittidder Dec 15 '22
Just passing through. Unfortunately, this subpar book started as "reasonably decent" blog posts but is not a good book for beginners. It is still being pushed as THE book for beginners. What clojure needed was a book like "Simply Scheme" but that ship sailed a long time ago.
63
u/v4ss42 Mar 09 '21
Can you please point me to these “Soviet propaganda” Clojure books? I’m very keen to combine two interests of mine into one.
28
u/Staffordrootbeer Mar 09 '21
Seriously! I would love for example to see someone write about using linear programming via Neanderthal to simulate a planned economy for instance.
25
u/v4ss42 Mar 09 '21
Yes! I have a personal yearning to learn more about the philosophy of communal ownership and the management of shared mutable state.
7
u/SimonGray Mar 09 '21
Structural sharing clearly worked in the USSR... or rather: it worked until the 1970s, when it finally became clear that those O(log32n) operations just couldn't keep up.
7
u/MindOfJay Mar 09 '21
The problem was their singular focus on Object-Oriented programming wrt Commodities. Turns out while they tried to become Stateless, all it did was hide the State through encapsulation.
14
2
4
u/dragandj Mar 09 '21
While I appreciate your recommendation of Neanderthal, I’ll have to note that Neanderthal helps with Linear algebra, not with Linear Programming which falls under Operations Research (which you may or may not be able to implement with linear algebra).
0
u/sartorish Mar 09 '21
This is a great idea, and something I've been thinking about a lot recently; with the climate crisis breathing down our necks, it's looking more and more like economic planning will be needed to avoid disaster. Frankly I don't even know where to start, though – are there datasets or simulation environments that would allow testing the resiliency of such a system?
2
u/MindOfJay Mar 09 '21
Paul Cockshott talks about using Linear Programming as a method of planning. His YouTube has even more information, including tackling the climate crisis.
2
9
Mar 09 '21
The Joy of Clojure and Clojure for the Brave and the True reads like manifests
12
u/CitrusLizard Mar 09 '21
As opposed to the objective technical tomes that they advertise themselves to be :-P.
But yeah, those books are more or less expressly intended to sell people on the language, and the benefits of it as seen by the authors - especially in the case of the Joy of Clojure, that is aimed at people familar with other programming languages. "A book that aims to change how I think sounds like propaganda!" is a surprised-pikachu meme that I can't be bothered to make right now.
12
u/slifin Mar 09 '21 edited Mar 09 '21
I'm a PHP/JS/CLJ/CLJS developer and I think perceptions of languages matter a lot
PHP's reputation has essentially caused PHP to pivot into a Java clone, Clojure has/had an even harder barrier to break in terms of the mass developer, even more so nearly a decade ago when these books were written
Re-reading those books can seem a bit cringe now, but modern documentation on Clojure is increasingly similar to JavaScript and other popular languages without the secret wizards tone
It's been really cool to see, it's clear the community increasingly doesn't see itself as obscure and obtuse
A big problem certainly in the CLJS world is the main site https://clojurescript.org/ mentions editors that are no longer supported, cli commands that are now deprecated (in the getting started)
I tried making a node app recently just following the main site's instructions using Cursive it started recommending JS packages that are hosted off of clojars I stopped following at that point
The fact shadow-cljs is not mentioned at all is underselling our ecosystem
Front and center should be npx create-cljs-project my-project with instructions for adding shadow or figwheel if you want them and then how to add npm packages, how to make node, react-native, web builds
Essentially we need more attention here: https://clojurescript.org/community/contributing#_editing_this_site myself included
I think most developers initially need a quick win in an afternoon in terms of having a workable thing, we could probably achieve that quite quickly now with something like calva or tutkain
9
15
u/CodeFarmer Mar 09 '21 edited Mar 09 '21
Not to be a dick about it, but a title like "The Joy of Clojure" might be a hint that you're getting a highly subjective slant on the philosophy and touchy feely side, with a heavy positive bias.
There are nuts and bolts texts a-plenty, if you want those.
7
u/jackdbd Mar 09 '21
Web Development with Clojure is nice. I also enjoyed chapter 7 of Seven Languages in Seven Weeks (the other chapters are about Ruby, Io, Prolog, Scala, Erlang, Haskell). Elements of Clojure is another great book, but definitely not for beginners.
8
u/Doombuggie41 Mar 10 '21 edited Mar 10 '21
Ironically, I believe the author of Web Dev w/ Clojure, u/yogthos, is a communist according to his twitter
10
1
u/CodeFarmer Mar 09 '21
I really enjoyed 7 Languages (we did it as a book club at work a couple of years back) but I found the Clojure chapter weird, in that it got heavily into the concurrency primitives - atoms, refs and so on - and didn't talk so much about all the stuff that distinguished Clojure as a language itself.
But it was a product of its time; I remember early on people were really excited about Clojure because of that stuff ("it has a whole STM implementation built in!"), the "hey this language is just really fun to write" train came later.
7
u/c_a_l_m Mar 09 '21
As someone writing a bunch of Typescript right now---all lisp hype is well-deserved and should be shouted from the rooftops.
1
u/tuxbass Jul 21 '22
As someone only starting their clojure journey - care to give real-life examples from your first hand experience?
2
u/c_a_l_m Jul 21 '22
I'd love to! Just go through my comment history and find my brother's name, then go to the subreddit of his favorite hobby, and message the mod of that subreddit for the correct format to ask me that again!
That was my experience with typescript---endless layers of shit, each layer requiring its own special format to access.
(I and the company I was working w/when I wrote the grandparent comment have since parted ways)
You can certainly write the same mess in clojure, but it's at least frowned on.
12
9
18
u/SickMoonDoe Mar 09 '21
Someone's parents didn't teach them to share, eh?
All you have to lose is your chains comrade.
10
u/joinr Mar 09 '21
Plenty of time for learning in gulag, tovarisch! Do not worry, your parents will be there too since they need benevolent wisdom of party as well.
4
4
u/lenkite1 Mar 10 '21
If you want a no-nonsense book try out https://pragprog.com/titles/shcloj3/programming-clojure-third-edition/
1
u/agile-is-what Mar 12 '21
Also Clojure Applied, I have them both and neither read like Soviet Propaganda
3
Mar 09 '21 edited Mar 09 '21
If you are an experienced dev, read everything in clojure.org while having https://clojure.org/api/cheatsheet opened and a REPL. Also read https://download.clojure.org/papers/clojure-hopl-iv-final.pdf. Start exploring/coding.
Joy of Clojure is pedantic, the author is more concerned with sounding and looking smart than teaching.
14
u/SimonGray Mar 09 '21
Many people find great value in The Joy of Clojure. I just reread the chapter on logic programming and it was a great introduction of the paradigm. You're not giving the authors a fair shake at all.
It's fine that you like the dry documentation-like stuff more, but you have to release that many people do appreciate some enthusiasm that mirrors their own. Learning a language like Clojure feels like an uphill journey in many ways so it's nice to have the good sides pointed out while you're learning.
Personally, I dislike _Why's Poignant Guide style books (the humour gets in the way for me), so I never recommend Clojure for the Brave and True. The Joy of Clojure is one the most popular books for a reason. Same goes for Brave and True. Not everyone learns stuff the same way.
5
u/Muoniurn Mar 09 '21
Thanks for this take! I guess I will try to go through the not-to-my-liking parts and perhaps the more technical chapters will be worth it after all.
I do want to highlight that I have no problem with the author or the content per se, it was solely the way it was written.
2
u/kynde Mar 09 '21
I have no problem with the author or the content per se, it was solely the way it was written.
Pot calling the kettle black.
4
u/onetom Mar 09 '21
I also found the tone / style of the "Brave Clojure" book annoying. It feels kinda childish to me. But the examples are good. The structure of the book is great from a didactic point of view. I still recommend it, but warn the readers to not be deterred by the style.
I'm happy to hear that I'm not alone :)
7
Mar 09 '21
Soviet propaganda??? You mean "opinions"? Most authors are going to include their opinions in their books. These aren't research papers!
11
u/the_hoser Mar 08 '21
The hardest part about getting into Clojure for me was the culty nature of a lot of the beginner material. Even some of the intermediate stuff out there starts to taste like kool-aid. And stay away from the conference videos...
But in the end I really enjoy Clojure.
1
u/chris_sasaurus Mar 15 '21
I was definitely put off when I'd ask questions of more experienced clojurians and their answers were some variation of "well Rich thinks x" when I was starting out.
3
3
u/onetom Mar 09 '21
It's not a book, but I don't think it sounds like any kind of propaganda. Also it's from a trusted source :)
Part 1: https://youtu.be/P76Vbsk_3J0
Part 2: https://youtu.be/hb3rurFxrZ8
and to understand better where does the hate for OOP come from: https://youtu.be/aSEQfqNYNAc
it's not really "just an opinion". it's an extremely well reasoned argument, IMHO.
3
2
u/daver Mar 16 '21
So, I’m days late to the party. Evidently, we established that some people don’t like some books and other people do. And nobody seems to like every book. And some people don’t like Clojure. And other people do. Do I have that about right? M’kay.
4
1
u/lambda_pie Mar 15 '21
I hear what you say and agree there's some cringey stuff that people write about <insert your language here> because they are super excited about it and want to convince the world that one's new favorite language is the best thing since sliced bread. I admit I myself feel like that about Clojure and sometimes sing its praises without moderation.
But (here comes the big but) I'd make a big mistake by closing books as soon as I bump something that looks like propaganda because I'd assume that book has nothing good to teach me which usually is not true. Keep the good parts, ignore the bad ones, that's the secret.
1
-5
Mar 09 '21 edited Mar 09 '21
Welcome to the programming language community where clueless languages zealots are the majority.
16
u/SimonGray Mar 09 '21 edited Mar 09 '21
Welcome to the programming language community where the Holden Caulfields of the world jump at every chance to call other people zealots or cultists when they express a liking of the language.
Also, I'm pretty sure this is just one of /u/urkut's alt accounts.
2
u/IVEBEENGRAPED Mar 09 '21
Oh no, that name gave me flashbacks to 10th grade English. Holden was the most pretentious, judgy, "phony" person who projected his insecurities onto everyone around him. The writing style was solid but the character and the storyline gave me unfathomable rage.
2
u/reddittidder Dec 15 '22
It is quite heartening to see how every lisp-like language community, slowly but surely, turns into comp.lang.lisp.
Must be something in that tasty koolaid.
-9
u/bubuli_breeder Mar 09 '21
yeah i know what you mean. Clojurists can be condescending twats sometimes. i would suggest reading Programming Clojure instead.
4
u/SimonGray Mar 09 '21
-3
u/bubuli_breeder Mar 09 '21
i think you being mad about it proves that it is a cult.
5
u/SimonGray Mar 09 '21
Or maybe most people simply subscribe to this subreddit to get Clojure news, while a couple of subscribers like to show up in the comments and act like they're better than everyone else, calling other Clojure users cultists and zealots, and it all starts to get a wee bit tiring to read the same fucking one-line declamations after a while...?
0
u/bubuli_breeder Mar 09 '21
i subscribe to this subreddit for the same purpose, too...because i like Clojure. but just like i something doesn’t mean i cannot criticize it.
you seem to have an impression that i come here only to attack Clojure and its followers...you can check out my history on this subreddit.
but yeah it’s fair that all i’ve been doing lately is negative: i should mix it up a bit. but, hey, it is Tuesday. 😝
2
u/SimonGray Mar 09 '21
I don't mind criticising, but those remarks are not actually about criticising any part of Clojure, but about elevating yourself above others. I wasn't joking when I compared urkut's alt to Holden Caulfield because that's literally the vibe I get.
And just to clarify, this isn't specific to Clojure at all. To me it's an archetype found at every software dev job I've ever had, the cynic programmer who likes to shit on things, while rarely contributing anything of value. Just in the past year or so they started proliferating in the comments here.
-2
u/bubuli_breeder Mar 09 '21
again, you seem to be just looking at my recent comments to somehow...figure me out. that is not fair.
2
u/SimonGray Mar 09 '21
To paraphrase:
i think you being mad about it proves that
it is a cultyou are.If you're gonna psychoanalyse other people in this subreddit and wider community don't be surprised when people give you the same treatment.
0
u/bubuli_breeder Mar 09 '21 edited Mar 09 '21
lol what does that even mean?touchébut nah i’m not mad at all. life is too short for that.
ninja edited
1
u/SimonGray Mar 09 '21
You serve me some bullshit "you mad bro?" comment and just pretend like it isn't your own crap when I send it back to you. Whatever dude.
Ninja edit: ok, you at least recognised it in your edit so let's shake virtual hands and call it a day. You're right, life is too short for that.
→ More replies (0)
5
u/joinr Mar 08 '21
What references?