Solve real-life programming problems with a fraction of the code that pure object-oriented programming requires. Use Scala and Clojure to solve in-depth problems with two sets of patterns: object-oriented patterns that become more concise with functional programming, and natively functional patterns. Your code will be more declarative, with fewer bugs and lower maintenance costs.
Functional languages have their own patterns that enable you to solve problems with less code than object-oriented programming alone. This book introduces you, the experienced Java programmer, to Scala and Clojure: practical, production-quality languages that run on the JVM and interoperate with existing Java. By using both the statically typed, type-inferred Scala and the dynamically typed, modern Lisp Clojure, you'll gain a broad understanding of functional programming.
For each pattern, you'll first see the traditional object-oriented solution, and then dig into the functional replacements in both Scala and Clojure. These patterns are common in the functional world and deserve to become part of your problem-solving toolkit. On the object-oriented side, you'll see many common patterns, such as Command, Strategy, and Null Object. On the functional side, you'll learn core functional patterns such as Memoization, Lazy Sequence, and Tail Recursion.
Each pattern helps you solve a common programming problem. Working through them gives you a set of patterns you can use to solve problems you come across while writing programs. Finally, you'll learn how to work your existing Java code into new Scala or Clojure projects. You can start off small, adding functional code little by little, so you can complement your existing knowledge with Scala and Clojure as these languages gain popularity on the JVM.
What You Need
Clojure 1.5 and Scala 2.10.Optionally, Eclipse with plugins.
"synopsis" may belong to another edition of this title.
Q&A with Michael Bevilacqua-Linn, author of "Functional Programming Patterns in Scala and Clojure"
Q. Why did you write "Functional Programming Patterns"?
A. Languages with a functional flavor are getting more and more mainstream, and I wanted to write something that would help folks with a lot of traditional OO pattern knowledge start to make the transition.
Q. I don't know Scala or Clojure. How hard would it be for me to understand the examples in the book?
A. This book is written for programmers who are new to Scala and Clojure, but who have significant experience with Java and object-oriented patterns. One of its goals is to help ease experienced object-oriented programmers into a more functional style.
Q. What can I do with functional patterns that I couldn't do before?
A. It's not so much what you can do, as what you can do better! Functional programming, and the patterns that go along with it, tends to be more declarative than imperative programming, so you can solve problems with code that's both more straightforward and shorter. The functional focus on immutable data reduces bugs in large programs, especially ones involving concurrency.
Q. Functional programming has no place in the object-oriented world, does it?
A. While object-oriented programming and functional programming are often seen as opposite paradigms, the truth is a bit more complex. Even Java is getting more of a functional style with Java 8's Lambdas. Scala explicitly blends object-oriented and functional styles. While Clojure is explicitly not object-oriented, it does borrow many good ideas from the object-oriented world, such as polymorphism and programming to interfaces.
Q. Which one should I use? Scala or Clojure? What are the differences and which would be easier to start with?
A. Scala tends to provide an easier on-ramp for object-oriented programmers, as they can start working with it in a mainly object-oriented style and transition to a more functional style as they gain more experience. Scala also has a sophisticated static type system, and blends object-oriented and functional programming together. Clojure, on the other hand, is a modern, practical Lisp and comes with the powerful macro system inherent to Lisps.
Both are excellent, general-purpose languages, but I have to confess that I prefer Clojure. I find that I can write clear, concise code it in much more easily than I can in any other language. However, knowing both will give you a very broad understanding of modern languages with a functional flavor.
5 Functional Programming Tips from Michael Bevilacqua-Linn, Author of “Functional Programming Patterns in Scala and Clojure”
Michael Bevilacqua-Linn has been programming computers ever since he dragged an Apple IIGS into his fifth grade class to explain loops and variables to pre-teenagers. He works for Comcast, where he builds distributed systems that power infrastructure for their next generation services. In his spare time he likes rock climbing and good beer, though not at the same time. He blogs at "mblinn.com":http://mblinn.com/.
"About this title" may belong to another edition of this title.
FREE shipping within U.S.A.
Destination, rates & speedsSeller: BooksRun, Philadelphia, PA, U.S.A.
Paperback. Condition: Good. 1. Ship within 24hrs. Satisfaction 100% guaranteed. APO/FPO addresses supported. Seller Inventory # 1937785475-11-1
Quantity: 1 available
Seller: HPB-Red, Dallas, TX, U.S.A.
Paperback. Condition: Good. Connecting readers with great books since 1972! Used textbooks may not include companion materials such as access codes, etc. May have some wear or writing/highlighting. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_374232507
Quantity: 1 available
Seller: ThriftBooks-Atlanta, AUSTELL, GA, U.S.A.
Paperback. Condition: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 1.05. Seller Inventory # G1937785475I4N00
Quantity: 1 available
Seller: ThriftBooks-Dallas, Dallas, TX, U.S.A.
Paperback. Condition: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 1.05. Seller Inventory # G1937785475I4N00
Quantity: 1 available
Seller: SecondSale, Montgomery, IL, U.S.A.
Condition: Good. Item in good condition. Textbooks may not include supplemental items i.e. CDs, access codes etc. Seller Inventory # 00074787658
Quantity: 1 available
Seller: Bay State Book Company, North Smithfield, RI, U.S.A.
Condition: good. The book is in good condition with all pages and cover intact, including the dust jacket if originally issued. The spine may show light wear. Pages may contain some notes or highlighting, and there might be a "From the library of" label. Boxed set packaging, shrink wrap, or included media like CDs may be missing. Seller Inventory # BSM.J6BH
Quantity: 1 available
Seller: GreatBookPrices, Columbia, MD, U.S.A.
Condition: As New. Unread book in perfect condition. Seller Inventory # 19742203
Quantity: 1 available
Seller: Chris Barmby MBE. C & A. J. Barmby, Kent, United Kingdom
Soft cover. Condition: As New. No Jacket. 1st Edition. xiv, 236pp. adverts. In as new clean condition with as new card. Seller Inventory # 7888
Quantity: 1 available
Seller: GreatBookPrices, Columbia, MD, U.S.A.
Condition: New. Seller Inventory # 19742203-n
Quantity: 1 available
Seller: BargainBookStores, Grand Rapids, MI, U.S.A.
Paperback or Softback. Condition: New. Functional Programming Patterns in Scala and Clojure: Write Lean Programs for the Jvm 0.98. Book. Seller Inventory # BBS-9781937785475
Quantity: 5 available