Polished Ruby Programming - Second Edition: Principles and practices for building scalable, maintainable, and performant software
暫譯: 精緻的 Ruby 程式設計 - 第二版:構建可擴展、可維護和高效能軟體的原則與實踐
Evans, Jeremy
- 出版商: Packt Publishing
- 出版日期: 2026-07-10
- 售價: $2,210
- 貴賓價: 9.5 折 $2,099
- 語言: 英文
- 頁數: 428
- 裝訂: Quality Paper - also called trade paper
- ISBN: 1803243643
- ISBN-13: 9781803243641
-
相關分類:
Ruby
海外代購書籍(需單獨結帳)
相關主題
商品描述
Learn design principles, best practices, and trade-offs involved in implementation approaches, to improve your Ruby programming skills
Key Features:
- Understand the design principles behind polished Ruby code, and trade-offs involved in different implementation approaches
- See how to use plugin systems to build libraries for maximum flexibility and performance
- Learn about the advantages and disadvantages of different approaches to concurrency
Book Description:
Most successful Ruby applications become more difficult to maintain as the codebase grows in size. Polished Ruby Programming, 2nd Edition provides you with the skills and advice you need to design Ruby programs and libraries that are robust, performant, scalable, and maintainable.
The book takes you through possible implementation approaches for many common programming situations, discusses the trade-offs inherent in each approach, and explains why you may sometimes choose to use different approaches. You'll start by learning fundamental Ruby programming principles, such as correctly using core classes, class and method design, variable usage, error handling, and code formatting. Then you'll move on to higher-level topics such as library design, metaprogramming, domain-specific languages, and refactoring. Finally, you'll learn about the pros and cons of different approaches to concurrency, what you should consider when deciding whether to use static types in your Ruby code, and how best to optimize your Ruby code.
The 2nd edition of Polished Ruby Programming has been updated to include relevant changes between Ruby 3.0 and 4.0. While most principles discussed in the book apply to all recent Ruby versions, some of the content in the book is specific to Ruby 4.0, the latest release at the time of publication.
What You Will Learn:
- Use Ruby's core classes and design custom classes effectively
- Explore the principles behind variable usage and method argument choice
- Design extensible libraries and plugin systems in Ruby
- Use metaprogramming and DSLs to avoid code redundancy
- Implement different approaches to testing and understand their trade-offs
- Discover design patterns, refactoring, and optimization with Ruby
- Learn about the trade-offs inherent in different concurrency approaches
- Determine whether using static types in Ruby makes sense for you
Who this book is for:
If you already know how to program in Ruby and want to learn more about the principles and best practices behind writing maintainable, scalable, optimized, and well-structured Ruby code, then this book is for you. Intermediate to advanced-level working knowledge of the Ruby programming language is expected to get the most out of this book.
Table of Contents
- Getting the Most out of Core Classes
- Designing Useful Classes
- Proper Variable Usage
- Methods and Their Parameters
- Handling Errors
- Formatting Code for Easy Reading
- Designing Your Library
- Designing for Extensibility
- Metaprogramming and When to Use It
- Designing Useful Domain-Specific Languages
- Testing to Ensure Your Code Works
- Handling Change
- Using Common Design Patterns
- Choosing Your Concurrency Approach
- Static or Duck
- Optimizing Your Code
商品描述(中文翻譯)
學習設計原則、最佳實踐及實作方法中的取捨,以提升您的 Ruby 程式設計技能
主要特色:
- 了解精緻 Ruby 代碼背後的設計原則,以及不同實作方法中的取捨
- 瞭解如何使用插件系統來構建具有最大靈活性和性能的庫
- 學習不同並發方法的優缺點
書籍描述:
隨著代碼庫的增長,大多數成功的 Ruby 應用程式變得越來越難以維護。《精緻 Ruby 程式設計(第二版)》提供了設計穩健、高效、可擴展且易於維護的 Ruby 程式和庫所需的技能和建議。
本書將帶您了解許多常見程式設計情境的可能實作方法,討論每種方法固有的取捨,並解釋為什麼有時您可能會選擇使用不同的方法。您將從學習基本的 Ruby 程式設計原則開始,例如正確使用核心類別、類別和方法設計、變數使用、錯誤處理和代碼格式化。然後,您將進入更高層次的主題,如庫設計、元程式設計、特定領域語言和重構。最後,您將學習不同並發方法的優缺點、在 Ruby 代碼中使用靜態類型時應考慮的因素,以及如何最佳化您的 Ruby 代碼。
《精緻 Ruby 程式設計(第二版)》已更新以包含 Ruby 3.0 和 4.0 之間的相關變更。雖然書中討論的大多數原則適用於所有近期的 Ruby 版本,但書中的某些內容是特定於 Ruby 4.0,即出版時的最新版本。
您將學到的內容:
- 有效使用 Ruby 的核心類別並設計自定義類別
- 探索變數使用和方法參數選擇背後的原則
- 在 Ruby 中設計可擴展的庫和插件系統
- 使用元程式設計和 DSL 來避免代碼冗餘
- 實作不同的測試方法並了解其取捨
- 發現設計模式、重構和 Ruby 的優化
- 了解不同並發方法中固有的取捨
- 判斷在 Ruby 中使用靜態類型是否對您有意義
本書適合誰:
如果您已經知道如何用 Ruby 程式設計,並希望了解撰寫可維護、可擴展、優化且結構良好的 Ruby 代碼背後的原則和最佳實踐,那麼這本書適合您。期望讀者具備中級到高級的 Ruby 程式語言工作知識,以便充分利用本書。
目錄
- 充分利用核心類別
- 設計有用的類別
- 正確的變數使用
- 方法及其參數
- 錯誤處理
- 代碼格式化以便於閱讀
- 設計您的庫
- 設計可擴展性
- 元程式設計及其使用時機
- 設計有用的特定領域語言
- 測試以確保您的代碼正常運作
- 處理變更
- 使用常見設計模式
- 選擇您的並發方法
- 靜態或 Duck
- 優化您的代碼