Functional Thinking
Paradigm Over Syntax
Publisher: O'Reilly Media
Final Release Date: June 2014
Pages: 180

If you’re familiar with functional programming basics and want to gain a much deeper understanding, this in-depth guide takes you beyond syntax and demonstrates how you need to think in a new way. Software architect Neal Ford shows intermediate to advanced developers how functional coding allows you to step back a level of abstraction so you can see your programming problem with greater clarity.

Each chapter shows you various examples of functional thinking, using numerous code examples from Java 8 and other JVM languages that include functional capabilities. This book may bend your mind, but you’ll come away with a much better grasp of functional programming concepts.

  • Understand why many imperative languages are adding functional capabilities
  • Compare functional and imperative solutions to common problems
  • Examine ways to cede control of routine chores to the runtime
  • Learn how memoization and laziness eliminate hand-crafted solutions
  • Explore functional approaches to design patterns and code reuse
  • View real-world examples of functional thinking with Java 8, and in functional architectures and web frameworks
  • Learn the pros and cons of living in a paradigmatically richer world

If you’re new to functional programming, check out Josh Backfield’s book Becoming Functional .

Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyFunctional Thinking
 
3.7

(based on 7 reviews)

Ratings Distribution

  • 5 Stars

     

    (2)

  • 4 Stars

     

    (2)

  • 3 Stars

     

    (2)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (0)

57%

of respondents would recommend this to a friend.

Pros

  • Helpful examples (5)
  • Easy to understand (4)

Cons

    Best Uses

    • Intermediate (5)
    • Novice (3)
    • Student (3)
      • Reviewer Profile:
      • Developer (7)

    Reviewed by 7 customers

    Sort by

    Displaying reviews 1-7

    Back to top

     
    4.0

    Intermediate level guide on FP

    By Marvin Lee

    from Malaysia

    About Me Developer

    Verified Reviewer

    Pros

    • Helpful examples
    • Well-written

    Cons

    • Need Some Basic Knowledge

    Best Uses

    • Intermediate

    Comments about oreilly Functional Thinking:

    This is an intermediate level guide on functional programming. For any beginners, they might actually need a better understanding of functional programming before going for this. However, the introduction and ending chapters are good for beginners too.
    Overall, this book provides useful code examples where functional programming can be beneficial and promotes the idea and possibilities of solving current programming problems with functional languages.

     
    4.0

    Great "next step" and comparison book

    By PatKu

    from Montana

    About Me Developer

    Verified Reviewer

    Pros

    • Concise
    • Helpful examples

    Cons

      Best Uses

      • Intermediate

      Comments about oreilly Functional Thinking:

      (Originally posted at http://www.amazon.com/review/RZ99XH4XB05LT and modified slightly here.)
      This book can be confusing, as it dives right in to functional programming (FP) without a primer or appendix to help beginners. (I strongly recommend [defmacro - Functional Programming For The Rest of Us](http://www.defmacro.org/ramblings/fp.html) for that purpose.) However, as an intermediate developer with an (apparently) above-average exposure to FP, I found this book to be extremely illuminating and incredibly useful for me to advance to the next level of FP understanding.

      Why did I find the book so valuable?
      * As you can see from the [hosted code](https://github.com/oreillymedia/functional_thinking), Ford accompanies all of his code examples with unit tests, which I find essential for understanding and trust.
      * Most examples are done in Clojure (a LISP variant for the JVM), Groovy (a dynamic JVM language), **and** Java 8 (sometimes using the Functional Java library), as well as a number in Scala. I find that comparisons between languages improve my learning and retention, in addition to giving extra perspective.
      * Ford guides the reader through the mix of terminology for the essential FP functions and how they differ by language: map (when it is called 'collect' and why; a.k.a select), reduce (when it is called 'collect'; plus how it differs from fold), and filter (a.k.a. where).
      * All concepts are followed by (or introduced with) example code - this is not just a theory book.
      * Some Design Patterns are reviewed and translated to their FP equivalents, which are often simpler.
      * He provides the best explanation of recursion I've ever read:
      "In reality, [recursion is] a computer-sciencey way to iterate over things by calling the same method from itself, reducing the collection each time, and always carefully ensuring you have an exit condition. Many times, recursion leads to easy-to-understand code because the core of your problem is the need to do the same thing over and over to a diminishing list."
      * Ford also provides a helpful explanation of Currying vs partial application (better in context, but here is the crux):
      "Currying describes the conversion of a multi-argument function into a chain of single-argument functions. It describes the transformation process, not the invocation of the converted function. The caller can decide how many arguments to apply, thereby creating a derived function with that smaller number of arguments. Partial application describes the conversion of a multi-argument function into one that accepts fewer arguments, with values for the elided arguments supplied in advance. The technique's name is apt: it partially applies some arguments to a function, returning a function with a signature that consists of the remaining arguments. With both currying and partial application, you supply argument values and return a function that's invokable with the missing arguments. But currying a function returns the next function in the chain, whereas partial application binds argument values to values that you supply during the operation, producing a function with a smaller arity (number of arguments). This distinction becomes clearer when you consider functions with arity greater than two. For example, the fully curried version of the process(x, y, z) function is process(x)(y)(z)"

      There were times that I skimmed through sections (particularly the ones heavy on a Java implementation of pattern matching), but overall I was extremely pleased with the content.

      (1 of 1 customers found this review helpful)

       
      2.0

      A lot of detail and at times confusing

      By opentrail

      from The Netherlands

      About Me Developer

      Verified Reviewer

      Pros

      • Some Helpful Examples

      Cons

      • Difficult to understand
      • Not comprehensive enough

      Best Uses

      • Expert
      • Intermediate

      Comments about oreilly Functional Thinking:

      Lots of examples, which at first I found useful but later I found myself skipping ahead finding them tiresome. Maybe the concepts (paradigms) need more clarity before the code examples?

      Having read the book I'm still not clear what functional thinking means... maybe I need to read it again. Paradigm over Syntax?

      The last chapter finishes abruptly with a pyramid of functional, imperative and DSL's with not enough explanation about the different uses.

      As it is I think the book needs an overhaul for the next edition. I didn't really get what I wanted from it.

      (3 of 3 customers found this review helpful)

       
      3.0

      An overview, for Java programmers

      By Ali

      from Portland, OR

      About Me Developer

      Verified Reviewer

      Pros

      • Easy to understand
      • Helpful examples

      Cons

      • Too basic

      Best Uses

      • Novice
      • Student

      Comments about oreilly Functional Thinking:

      I read the early release version, which contains some typos and is missing the finalized citations and images. And apparently missing some connective tissue as well, as the transitions between sections are a bit choppy.

      Despite the book's length, it is essentially an overview, with the principles of functional programming condensed into a couple of chapters, giving examples of functional code and contrasting it with imperative or OO code.

      I liked that the functional code examples were in a variety of languages, giving a glimpse of the variety available, and letting the reader translate into the language of his/her own choice. I disliked that all of the imperative code examples were in Java, which seems to be an awkward choice for imperative code, being so strictly OO.

      A large chunk of the book was given to showing how to get functional languages to do OO sorts of things, and OO languages, specifically Java, to do functional things. On one level this makes sense, as you would want to have the widest variety of tools available in whatever language you choose to use. But on another it makes me feel uneasy, as if you're trying to get around the fact that you didn't choose the right language for the task in the first place.

      I would recommend this book for programmers who grew up with Java, and know nothing else, as it will expose them to different ways of doing things. But more experienced programmers would be less likely to learn much from it.

      (2 of 2 customers found this review helpful)

       
      3.0

      A little too fragmented

      By Fish

      from Prague, CZ

      About Me Developer

      Verified Buyer

      Pros

      • Easy to understand

      Cons

      • Too basic
      • Too many errors
      • Too Many Languages

      Best Uses

      • Novice
      • Student

      Comments about oreilly Functional Thinking:

      I understand that this book is about a programming paradigm rather than one particular programming language but I find it unfortunate that the author jumps through quite a lot of different functional languages in the examples. It would be much better to select one language for all examples and let the reader translate the code to their own favorite language. Since there were at least four different languages (as far as I recall), each with different names for the important operators (map, reduce), I got lost in the examples easily.

      Besides that, the topic was presented in an understandable way. On the other hand, I was expecting to learn a little more; most of the concepts described in the book were known to me. Maybe I am already thinking functionally.

      The early release contained a couple of errors but I suppose that these will be corrected in the final version.

      (1 of 1 customers found this review helpful)

       
      5.0

      Great comparison to OO thinking

      By Dave

      from Prior Lake, MN

      About Me Designer, Developer, Sys Admin

      Verified Reviewer

      Pros

      • Easy to understand
      • Helpful examples

      Cons

        Best Uses

        • Expert
        • Intermediate

        Comments about oreilly Functional Thinking:

        Neal Ford does an excellent job comparing OO and Functional thinking by outlining examples in Java, Groovy, Scala and Clojure. You really don't need prior knowledge of those other languages to understand the concepts (although I had to re-read the Clojure code a few times to internalize it).

        All the examples provide a solid foundation to help the reader transition from a purely OO design into one that mixes in functional constructs. Some of the examples are carried throughout the chapters which I found helpful to reinforce the concepts.

        (1 of 2 customers found this review helpful)

         
        5.0

        Great book!

        By Dead eye Jerry

        from Highland, UT

        About Me Developer

        Verified Buyer

        Pros

        • Accurate
        • Concise
        • Easy to understand
        • Good Pace
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Intermediate
          • Novice
          • Student

          Comments about oreilly Functional Thinking:

          Whoever has been to Neal's presentations knows of his ability to put things in simple terms, his pedagogical approach to things.
          The book has that same characteristic. It goes over the diff between learning a new language and learning a new paradigm, and he helps you start thinking in functional terms very effectively.
          Great job, Neal!

          Displaying reviews 1-7

          Back to top

           
          Buy 2 Get 1 Free Free Shipping Guarantee
          Buying Options
          Immediate Access - Go Digital what's this?
          Ebook: $31.99
          Formats:  DAISY, ePub, Mobi, PDF
          Print & Ebook: $43.99
          Print: $39.99