13 Mar 2013, 13:10
Generic-user-small

Michael Bevilacqua-Linn (13 posts)

Hello Gentle Readers,

Welcome to the forum for my book. If you’ve got any questions, comments, virtually thrown tomatoes, etc, this is the place for them.

Looking forward to hearing from you!

Thanks, MBL

13 Mar 2013, 16:01
Generic-user-small

Florent (4 posts)

Hi Michael,

The book presentation says

bq. This book introduces you, the experienced Java programmer, to Scala and Clojure

I’m very interested by the book, but I don’t know Java. I know Ruby however, and I’m quite experienced with OO programming. Do you think that could be enough to be able to benefit from your book?

Thanks! Florent

13 Mar 2013, 16:37
Generic-user-small

Michael Bevilacqua-Linn (13 posts)

Hey Florent,

Thanks for the interest!

There’s not much actual Java in the book, with the exception of a single extended example in the ‘Tinyweb’ chapter. The rest of the Java code is pretty minimal, sketches of object oriented patterns that I assume the reader already knows. They’re presented as a brief refresher.

So if you’re used to using the patterns I’m covering, thinks like Command and Null Object, in Ruby then it should be useful for you.

The main reason I focused on Java programmers rather than just generic OO is that both Scala and Java run on the JVM, so there’s a lot of interest amongst Java programmers, and I’ve noticed that Java code tends to be a lot more pattern-heavy than other OO languages, so it seemed like a natural fit :-)

13 Mar 2013, 18:47
Generic-user-small

Stephen Telford (2 posts)

Hey Michael I am wondering, are you going to touch on the GoF patterns and how they relate to clojure/scala ? Singleton/Borg, Flyweight, etc. I think it would be a good mental mapping for those new to the language, even if it is a paragraph or two saying how this one is obsolete due to STM or whatever.

I also would be interested in, rather than the Null Object, of also seeing a bit about Monads in Clojure (which is what I assume you are going to end up talking about, merely wanting to confirm)

Regards S.

13 Mar 2013, 19:29
Generic-user-small

Michael Bevilacqua-Linn (13 posts)

Hey Stephen,

Yep, I cover a lot of the common GoF patterns, in fact the entire first section of the book is dedicated to showing how you can replace common OO patterns with functional stuff from Clojure and Scala. About half of these are Gof patterns, the full list can be found here - http://pragprog.com/book/mbfpp/functional-programming-patterns-in-scala-and-clojure

I’m a bit torn on monads, currently my coverage of Null Object doesn’t include the Maybe monad in Clojure, since it’s not part of the core language. I do, however, go over Option in Scala. Pulling in Maybe from algo.monads seems like a good idea, but on the other hand monads aren’t particularly idiomatic in Clojure.

I was currently planning on covering monads only in a (yet unwritten) pattern called Chain of Transformations, but the more I think about it, I should at least cover Maybe as well.

Thanks for the feedback!

Thanks, MBL

13 Mar 2013, 19:45
Generic-user-small

Mark Derricutt (1 post)

Love the book so far and I’m on the first few pages :) As for clojure, if you’re going to talk Option etc. the new core.typed module has one of them I believe.

13 Mar 2013, 20:11
Generic-user-small

Michael Bevilacqua-Linn (13 posts)

Thanks for the kind words,

Interesting, I was eying up the Maybe in algo.monads (part of the library formerly known as Clojure Contrib), but that might be more suitable.

Thanks, MBL

13 Mar 2013, 21:01
Generic-user-small

Stephen Telford (2 posts)

Hey Michael, Good show on the GoF stuff. I am sure this will make a lot of people’s transition easier.

The talk by Douglas Crockford showed that you could explain Monads without all that horrible maths (that a certain FP tries to force on people). I think it’s definitely a FP pattern that trips up a lot of people, but it also removes a whole class of non-FP errors. I agree that it’s not idiomatic clojure, but I hope you touch on it in some aspect. Even the Identity and Maybe monad could be ‘good enough’, with pointers for further learning if people desired.

Regards and Good Luck :) S.

13 Mar 2013, 21:56
Generic-user-small

Michael Bevilacqua-Linn (13 posts)

Thanks yeah,

I didn’t realize that the optional type system was so far along, that makes something like Maybe or Option make a whole lot more sense in Clojure, so I’m inclined to add it in.

Thanks again, MBL

  You must be logged in to comment