HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
The Joy of Clojure

Michael Fogus, Chris Houser · 3 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "The Joy of Clojure" by Michael Fogus, Chris Houser.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
Summary The Joy of Clojure, Second Edition is a deep look at the Clojure language. Fully updated for Clojure 1.6, this new edition goes beyond just syntax to show you the "why" of Clojure and how to write fluent Clojure code. You'll learn functional and declarative approaches to programming and will master the techniques that make Clojure so elegant and efficient. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Technology The Clojure programming language is a dialect of Lisp that runs on the Java Virtual Machine and JavaScript runtimes. It is a functional programming language that offers great performance, expressive power, and stability by design. It gives you built-in concurrency and the predictable precision of immutable and persistent data structures. And it's really, really fast. The instant you see long blocks of Java or Ruby dissolve into a few lines of Clojure, you'll know why the authors of this book call it a "joyful language." It's no wonder that enterprises like Staples are betting their infrastructure on Clojure. About the Book The Joy of Clojure, Second Edition is a deep account of the Clojure language. Fully updated for Clojure 1.6, this new edition goes beyond the syntax to show you how to write fluent Clojure code. You'll learn functional and declarative approaches to programming and will master techniques that make Clojure elegant and efficient. The book shows you how to solve hard problems related to concurrency, interoperability, and performance, and how great it can be to think in the Clojure way. Appropriate for readers with some experience using Clojure or common Lisp. What's Inside Build web apps using ClojureScript Master functional programming techniques Simplify concurrency Covers Clojure 1.6 About the Authors Michael Fogus and Chris Houser are contributors to the Clojure and ClojureScript programming languages and the authors of various Clojure libraries and language features. Table of Contents PART 1 FOUNDATIONS Clojure philosophy Drinking from the Clojure fire hose Dipping your toes in the pool PART 2 DATA TYPES On scalars Collection types PART 3 FUNCTIONAL PROGRAMMING Being lazy and set in your ways Functional programming PART 4 LARGE-SCALE DESIGN Macros Combining data and code Mutation and concurrency Parallelism PART 5 HOST SYMBIOSIS Java.next Why ClojureScript? PART 6 TANGENTIAL CONSIDERATIONS Data-oriented programming Performance Thinking programs Clojure changes the way you think
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
I approached learning Clojure the way I approach learning everything else. I survey the resources available, then pick the two best books. Ideally, I want them to come at it from different perspectives. e.g. one may place an emphasis on doing stuff with Clojure while another may be more about functional programming.

At the time, they were:

https://www.amazon.com/Clojure-Programming-Chas-Emerick-eboo...

https://www.amazon.com/Joy-Clojure-Michael-Fogus/dp/16172914...

I then wrote a data processing app in Clojure; consuming financial data and finding patterns in it.

My suggestions are: 1) If this is your first time learning a functionally-oriented language, clear your mind from any kind of assumptions picked up from other languages.

2) Get a handle on the core tenets of functional programming: immutability, purity, composition, and functions as objects. If you know Javascript, then a lot of this stuff may already be familiar to you. JS is underrated in that department imo.

3) To me, writing programs with Clojure is akin to playing with Lego. You write your base functions, then higher-level functions which use those base functions, and so on. Functions all the way down.

4) Write something with it; it'll force you to decompose your program and think functionally.

Clojure is a simple, opinionated language. I don't think you'll have a hard time picking it up at all. The hard part will be to think in a manner amenable to it.

These days, I think Clojurescript has overtaken Clojure in terms of traction, so if you're into webdev, then CJS would be a natural next step.

happyslobro
Where did you get this financial data for your first project? Is it a public feed / API? This sounds like exactly the sort of thing that I would like to start playing and eventually working with. I had been assuming that this type of data would only be available to the kind of entities that have a compliance officer, but I would love to have that assumption proven wrong.
Veen
> You write your base functions, then higher-level functions which use those base functions, and so on. Functions all the way down.

I'm hoping to follow a similar trajectory to you, but with Elixir instead of closure. At the moment though, I tend to do things the other way around: write the top level functions and then fill out the base functions.

So I'd start a module with

def whatever(something), do: something |> function1 |> function2 |> function3

Then I'll write function1, 2, and 3 and whatever helper functions they need. And so on until it works. Maybe doing it your way is a better approach: helps you think it through first.

(although I'm aware some would say that tests should come before everything else anyway)

fsloth
"some would say that tests should come before everything else anyway"

Which some others consider a cargo-cult practice if done mandatorily for it's own sake.

Good luck on your studies!

bpicolo
It is useful and necessary to use both directions at times. You can't always presuppose the relevant details. But do be ready to factor away functions at a moments notice
Clojure: The Joy of Clojure. Not for beginners, but it's excellent.

http://www.amazon.com/Joy-Clojure-Michael-Fogus/dp/161729141...

I've heard good thing about Clojure for the Brave and True, free online:

http://www.braveclojure.com/

brudgers
Halloway's Programming Clojure isn't exactly recent, but it's available used, has a lot of depth like Joy of Clojure, but is targeted at beginners. Clojure from the Ground Up is free and online, it's awesome and so is Aphyr.

https://aphyr.com/tags/Clojure-from-the-ground-up

Code Complete 2 [1] was one of the first coding books I've read. As with anything else, it's good to look around (HN is a good place) for people who have problems with the book. I think I learn as much reading the commentary people make about books like that as I do from the book itself.

I think I've listened to every podcast on software engineering radio a few times [2]. The older ones are especially nice because they usually pick a specific topic and cover the high points. I liked that I could listen to it while I was driving, or otherwise not in front of a computer.

It's specific, but Javascript: The Good Parts is probably the most used book I have on my shelf. It has such a perfect amount of usable information in it. It's pretty great. Again, it's definitely worth looking up critiques and counterpoints.

I've also got Introduction to Algorithms, which I use as a reference, sometimes. I switched over to The Algorithm Design Manual [5] after I saw it referenced in an older Steve Yegge post [6]. I read through the intro and it seemed like a book that would be more appropriate from an autodidactic standpoint. I really have no idea if that's going to pan out, since I'm not that far into it, but we'll see, for sure. Doesn't kill me to have an extra algorithms book laying about, though, and I've always got intro to algorithms for cross reference. I've found that I really need to have as many sources available as possible when I'm learning alone. Usually I don't get something until the fifth person describes it from the tenth different angle.

That's most of what I can think of off hand. I really enjoyed The Joy of Clojure [7], though haven't checked out the newer version. Programming Collective Intelligence [8] is a fun book, and is what made me want to go back down the maths route to get more into machine learning.

And of course habitually reading hacker news for an hour or three every night :)

So that's my totally inexpert list of random stuff that I enjoy

[1] http://www.amazon.com/Code-Complete-Practical-Handbook-Const... [2] http://www.se-radio.net/ [3] http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfor... [4] http://www.amazon.com/Introduction-Algorithms-Thomas-H-Corme... [5] http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/... [6] http://steve-yegge.blogspot.com/2008/03/get-that-job-at-goog... [7] http://www.amazon.com/Joy-Clojure-Michael-Fogus/dp/161729141... [8] http://www.amazon.com/Programming-Collective-Intelligence-Bu...

HN Books is an independent project and is not operated by Y Combinator or Amazon.com.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.