Functional PHP
暫譯: 函數式 PHP
Gilles Crettenand
- 出版商: Packt Publishing
- 出版日期: 2017-02-17
- 售價: $1,880
- 貴賓價: 9.5 折 $1,786
- 語言: 英文
- 頁數: 342
- 裝訂: Paperback
- ISBN: 1785880322
- ISBN-13: 9781785880322
-
相關分類:
PHP
海外代購書籍(需單獨結帳)
買這商品的人也買了...
-
$1,188Core Java, Volume II--Advanced Features, 9/e (Paperback)
-
$1,850$1,758 -
$900PHP Arrays: Single, Multi-dimensional, Associative and Object Arrays in PHP 7
-
$2,010$1,910 -
$2,800$2,660
商品描述
Key Features
- Greatly improve your code quality, testability, and readability using modern functional programming techniques
- Get a solid foundation in functional programming techniques and methodologies
- Step-by-step learn the concepts to architect more robust code
Book Description
A functional approach encourages code reuse, greatly simplifies testing, and results in code that is concise and easy to understand. This book will demonstrate how PHP can also be used as a functional language, letting you learn about various function techniques to write maintainable and readable code.
After a quick introduction to functional programming, we will dive right in with code examples so you can get the most of what you ve just learned. We will go further with monads, memoization, and property-based testing. You will learn how to make use of modularity of function while writing functional PHP code.
Through the tips and best practices in this book, you ll be able to do more with less code and reduce bugs in your applications. Not only will you be able to boost your performance, but you will also find out how to eliminate common loop problems. By the end of the book, you will know a wide variety of new techniques that you can use on any new or legacy codebase.
What you will learn
- Declare functions/callables and find out how to manipulate and call them
- Write pure functions to get more robust code that can be easily tested
- Learn to compose function using various techniques
- Use a functional approach to find readable solutions to common issues
- Utilize performance optimization techniques such as laziness, memorization, and parallelization
- Build the business logic of applications with the functional paradigm
- Test functional code and know how to speed up test runs using parallel testing
- Understand the impact and limitation of functional programming in PHP
About the Author
Gilles Crettenand is a passionate and enthusiastic software developer. He thrives when solving challenges and is always on the lookout for a better way to implement his solutions. He has a bachelor's degree in computer science from the School of Engineering and Management Vaud in Switzerland and has more than 6 years of experience as a web developer.
Most of his professional career has been spent using PHP, developing a variety of applications ranging from accountability software to e-commerce solutions and CMS. At nights, however, he likes to try other languages, dabbling with Haskell, Scala, and more recently, PureScript, Elm, and Clojure.
Being a certified scrum master, he understands the need to use the right tool for the job and maintaining a readable and maintainable codebase using the best techniques and practices available.
Table of Contents
- Functions as First Class Citizens in PHP
- Pure Functions, Referential Transparency, and Immutability
- Functional Basis in PHP
- Composing Functions
- Functors, Applicatives, and Monads
- Real-Life Monads
- Functional Techniques and Topics
- Testing
- Performance Efficiency
- PHP Frameworks and FP
- Designing a Functional Application
- What Are We Talking about When We Talk about Functional Programming
商品描述(中文翻譯)
主要特點
- 使用現代函數式編程技術大幅提升您的程式碼質量、可測試性和可讀性
- 建立堅實的函數式編程技術和方法論基礎
- 逐步學習概念以架構更穩健的程式碼
書籍描述
函數式方法鼓勵程式碼重用,大大簡化測試,並產生簡潔且易於理解的程式碼。本書將展示如何將 PHP 作為函數式語言使用,讓您學習各種函數技術,以編寫可維護和可讀的程式碼。
在快速介紹函數式編程後,我們將直接進入代碼示例,以便您能夠充分利用剛學到的知識。我們將進一步探討單子(monads)、記憶化(memoization)和基於屬性的測試(property-based testing)。您將學會在編寫函數式 PHP 程式碼時如何利用函數的模組化。
通過本書中的提示和最佳實踐,您將能夠用更少的程式碼做更多的事情,並減少應用程式中的錯誤。您不僅能提升性能,還會發現如何消除常見的迴圈問題。在書籍結束時,您將了解各種新技術,這些技術可以應用於任何新的或舊的代碼庫。
您將學到什麼
- 聲明函數/可調用對象,並了解如何操作和調用它們
- 編寫純函數以獲得更穩健且易於測試的程式碼
- 學習使用各種技術來組合函數
- 使用函數式方法找到可讀的解決方案來解決常見問題
- 利用性能優化技術,如懶惰(laziness)、記憶化(memorization)和並行化(parallelization)
- 使用函數式範式構建應用程式的業務邏輯
- 測試函數式程式碼,並了解如何使用並行測試加速測試運行
- 理解函數式編程在 PHP 中的影響和限制
關於作者
Gilles Crettenand 是一位充滿熱情和熱忱的軟體開發者。他在解決挑戰時茁壯成長,並始終尋找更好的方法來實現他的解決方案。他擁有瑞士沃州工程與管理學院的計算機科學學士學位,並擁有超過 6 年的網頁開發經驗。
他的大部分職業生涯都在使用 PHP,開發各種應用程式,從會計軟體到電子商務解決方案和內容管理系統(CMS)。然而,到了晚上,他喜歡嘗試其他語言,涉獵 Haskell、Scala,以及最近的 PureScript、Elm 和 Clojure。
作為一名認證的 Scrum Master,他理解在工作中使用合適工具的必要性,並使用最佳技術和實踐來維護可讀和可維護的程式碼庫。
目錄
- PHP 中的函數作為第一類公民
- 純函數、參考透明性和不可變性
- PHP 中的函數式基礎
- 組合函數
- 函子(Functors)、應用函子(Applicatives)和單子(Monads)
- 現實生活中的單子
- 函數式技術和主題
- 測試
- 性能效率
- PHP 框架與函數式編程
- 設計函數式應用程式
- 當我們談論函數式編程時,我們在談論什麼