Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Francis Avila

+ Follow
since Jan 29, 2016
Francis likes ...
IntelliJ IDE Clojure
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Francis Avila

The book does not specifically address the problems of Java programmers starting to write Clojure, or even how to introduce Clojure into your Java shop. However, the book does two things which relate to your questions:

1. We go into details of Java-Clojure interop, so that a Java programmer knows how to import and use Java libraries or create classes, instances, proxies, etc from Clojure that he is already familiar with.

2. We talk a lot about how Clojure favors immutability, how this is different from other languages (Java included), and what that means when trying to write programs "the Clojure way."

I was not a Java programmer before I came to Clojure so I can't really say what I experienced unlearning Java; however immutability in particular really seems to trip most people up regardless of their previous programming experience. Some Clojure people I know with more Java experience tell me this article helped them to understand the difference a bit better and carry some Clojure lessons back to Java, too.
5 years ago
The book does explain the basics of the functional programming (FP) style and does not assume any prior FP knowledge. It also walks you through the process of creating some more ambitious programs to help you acquire an intuition for designing a nontrivial program in a functional style.

The book does, however, assume some programming experience! It may move too quickly and assume to much for an "introduction to programming" book.
5 years ago
I'm not sure what you mean by "as closures in Clojure". Java lambdas capture their scope lexically just like a Clojure function would, so if you define something in Java it's going to capture the surrounding Java scope. I'm not sure what it would mean for Java code to capture a Clojure scope! You can of course call Java code that uses lambdas from Clojure, or even call lambdas directly (although it may be trickier than normal because of the invisible interfaces involved). Could you expand more on what you would like to do, maybe with a code example?

There is also a discussion about Java 8 lambda interop in Clojure which may be of help to you.
5 years ago
When I started work on the second edition Clojure 1.7 was still beta (not yet even release-candidate); Clojure 1.8 was released less than a month after the book went to print.

The first Clojure version I knew was 1.4 or 1.5, so I have no first-hand experience of the tooling and library upheavals in 1.3. From what I hear, lot less has changed between Clojure 1.6 and 1.8 than between 1.2 and 1.3. I myself still actively develop on projects that use Clojure 1.6, although they will probably be upgraded soon since the upgrade is relatively painless.

The fundamentals of Clojure and Clojure's FP style is unchanged between 1.6 and 1.8, so I still think this book is a solid introduction to Clojure for someone who has no Clojure or FP experience. It's not a great book for someone who has some Clojure experience and is looking for more. For that I recommend The Joy of Clojure, now in a second edition, but alas also updated for Clojure 1.6, not 1.7 or 1.8.

Clojure 1.7 added transducers and reader conditionals; Clojure 1.8 added the socket server, direct linking, and some more clojure.string functions to ease interop. Of these, the only feature I sincerely regret not being able to devote a chapter to is transducers (and reducers, a closely-related 1.6 feature I also don't talk about but which I would have liked to). Transducers add a new 1-arity to most of the core sequence-processing functions which I'm sure a beginner will accidentally stumble into and be very puzzled by. Also, transducers+reducers (and the IReduce protocol) are part of what makes Clojure special. I'm also not sure if there is a Clojure intro book currently in print which talks about transducers, so it also would have been nice to be first-to-print with that.
5 years ago