Functional Programming Patterns in Scala and Clojure: Write Lean Programs for the JVM (Paperback)
暫譯: Scala 和 Clojure 的函數式程式設計模式:為 JVM 編寫精簡程式

Michael Bevilacqua-Linn

買這商品的人也買了...

商品描述

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.

商品描述(中文翻譯)

解決現實生活中的程式設計問題,所需的程式碼量僅為純物件導向程式設計的一小部分。使用 Scala 和 Clojure 來解決深入的問題,透過兩組模式:隨著函數式程式設計變得更簡潔的物件導向模式,以及原生的函數式模式。您的程式碼將更具聲明性,錯誤更少,維護成本更低。

函數式語言擁有自己的模式,使您能夠用比單純的物件導向程式設計更少的程式碼來解決問題。本書將帶您這位經驗豐富的 Java 程式設計師,介紹 Scala 和 Clojure:這些在 JVM 上運行並與現有 Java 互操作的實用、可生產的語言。通過使用靜態類型、類型推斷的 Scala 和動態類型、現代 Lisp 的 Clojure,您將對函數式程式設計有更廣泛的理解。

對於每個模式,您將首先看到傳統的物件導向解決方案,然後深入探討 Scala 和 Clojure 中的函數式替代方案。這些模式在函數式世界中很常見,值得成為您解決問題工具箱的一部分。在物件導向方面,您將看到許多常見模式,例如 Command、Strategy 和 Null Object。在函數式方面,您將學習核心函數式模式,如 Memoization、Lazy Sequence 和 Tail Recursion。

每個模式都幫助您解決一個常見的程式設計問題。逐步解決這些問題將為您提供一組可以用來解決在編寫程式時遇到的問題的模式。最後,您將學會如何將現有的 Java 程式碼整合到新的 Scala 或 Clojure 專案中。您可以從小處著手,逐步添加函數式程式碼,這樣您就可以隨著這些語言在 JVM 上的流行,補充您現有的知識。

您需要的工具:
Clojure 1.5 和 Scala 2.10。可選擇使用帶有插件的 Eclipse。

最後瀏覽商品 (20)