Effective Ruby: 48 Specific Ways to Write Better Ruby (Paperback)
暫譯: 有效的 Ruby:48 種寫出更好 Ruby 的具體方法 (平裝本)

Peter J. Jones

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

相關主題

商品描述

If you’re an experienced Ruby programmer, Effective Ruby will help you harness Ruby’s full power to write more robust, efficient, maintainable, and well-performing code. Drawing on nearly a decade of Ruby experience, Peter J. Jones brings together 48 Ruby best practices, expert tips, and shortcuts—all supported by realistic code examples.

 

Jones offers practical advice for each major area of Ruby development, from modules to memory to metaprogramming. Throughout, he uncovers little-known idioms, quirks, pitfalls, and intricacies that powerfully impact code behavior and performance.

Each item contains specific, actionable, clearly organized guidelines; careful advice; detailed technical arguments; and illuminating code examples. When multiple options exist, Jones shows you how to choose the one that will work best in your situation.

 

Effective Ruby will help you systematically improve your code—not by blindly following rules, but by thoroughly understanding Ruby programming techniques.

 

Key features of this concise guide include

  • How to avoid pitfalls associated with Ruby’s sometimes surprising idiosyncrasies
  • What you should know about inheritance hierarchies to successfully use Rails (and other large frameworks)
  • How to use misunderstood methods to do amazingly useful things with collections
  • Better ways to use exceptions to improve code reliability
  • Powerful metaprogramming approaches (and techniques to avoid)
  • Practical, efficient testing solutions, including MiniTest Unit and Spec Testing
  • How to reliably manage RubyGem dependencies
  • How to make the most of Ruby’s memory management and profiling tools
  • How to improve code efficiency by understanding the Ruby interpreter’s internals

商品描述(中文翻譯)

如果您是一位經驗豐富的 Ruby 程式設計師,**《Effective Ruby》** 將幫助您充分發揮 Ruby 的力量,撰寫更穩健、高效、可維護且表現良好的程式碼。彼得·J·瓊斯(Peter J. Jones)結合近十年的 Ruby 經驗,整理出 48 條 Ruby 最佳實踐、專家建議和捷徑,並以現實的程式碼範例作為支持。

瓊斯針對 Ruby 開發的每個主要領域提供實用建議,從模組到記憶體再到元程式設計。在整個過程中,他揭示了鮮為人知的慣用語、特性、陷阱和細微之處,這些都會強烈影響程式碼的行為和性能。

每個項目都包含具體、可行、組織清晰的指導方針;謹慎的建議;詳細的技術論證;以及啟發性的程式碼範例。當存在多個選項時,瓊斯會告訴您如何選擇最適合您情況的選項。

**《Effective Ruby》** 將幫助您系統性地改善您的程式碼——不是盲目遵循規則,而是徹底理解 Ruby 程式設計技術。

這本簡明指南的主要特點包括:
- 如何避免與 Ruby 有時令人驚訝的特性相關的陷阱
- 您應該了解的繼承層次結構,以成功使用 Rails(及其他大型框架)
- 如何利用被誤解的方法,對集合進行驚人有用的操作
- 更好的方式使用例外來提高程式碼的可靠性
- 強大的元程式設計方法(以及應避免的技術)
- 實用、高效的測試解決方案,包括 MiniTest 單元測試和規範測試
- 如何可靠地管理 RubyGem 依賴
- 如何充分利用 Ruby 的記憶體管理和性能分析工具
- 如何通過理解 Ruby 解譯器的內部運作來提高程式碼效率