![]() 作者:Peter J. Jones 出版社: Addison-Wesley Professional 副标题: 48 Specific Ways to Write Better Ruby 出版年: 2014-10-5 页数: 240 定价: USD 39.99 装帧: Paperback ISBN: 9780133846973 内容简介 · · · · · ·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 Jones brings together 48 Ruby best practices, expert tips, and shortcuts—all supported by realistic code examples. Jones offers practical advice for each maj... 作者简介 · · · · · ·Peter J. Jones has been working professionally with Ruby since 2005. He began programming before he learned how to properly use a keyboard, after stumbling upon a Commodore 64, a few code listings, and some cassette tapes. Peter is a freelance software engineer and a senior instructor for programming related workshops taught by Devalot.com. 目录 · · · · · ·PrefaceAcknowledgments About the Author Chapter 1: Accustoming Yourself to Ruby Item 1: Understand What Ruby Considers To Be True Item 2: Treat All Objects As If They Could Be nil · · · · · ·() Preface Acknowledgments About the Author Chapter 1: Accustoming Yourself to Ruby Item 1: Understand What Ruby Considers To Be True Item 2: Treat All Objects As If They Could Be nil Item 3: Avoid Ruby's Cryptic Perlisms Item 4: Be Aware That Constants Are Mutable Item 5: Pay Attention to Runtime Warnings Chapter 2: Classes, Objects, and Modules Item 6: Know How Ruby Builds Inheritance Hierarchies Item 7: Be Aware of the Different Behaviors of super Item 8: Invoke super When Initializing Sub-classes Item 9: Be Alert for Ruby's Most Vexing Parse Item 10: Prefer Struct to Hash for Structured Data Item 11: Create Namespaces by Nesting Code in Modules Item 12: Understand the Different Flavors of Equality Item 13: Implement Comparison via "<=>" and the Comparable Module Item 14: Share Private State Through Protected Methods Item 15: Prefer Class Instance Variables to Class Variables Chapter 3: Collections Item 16: Duplicate Collections Passed as Arguments Before Mutating Them Item 17: Use the Array Method to Convert nil and Scalar Objects into Arrays Item 18: Consider Set for Efficient Element Inclusion Checking Item 19: Know How to Fold Collections with reduce Item 20: Consider Using a Default Hash Value Item 21: Prefer Delegation to Inheriting from Collection Classes Chapter 4: Exceptions Item 22: Prefer Custom Exceptions to Raising Strings Item 23: Rescue the Most Specific Exception Possible Item 24: Manage Resources with Blocks and ensure Item 25: Exit ensure Clauses by Flowing off the End Item 26: Bound retry Attempts, Vary Their Frequency, and Keep an Audit Trail Item 27: Prefer throw to raise for Jumping Out of Scope Chapter 5: Metaprogramming Item 28: Familiarize Yourself with Module and Class Hooks Item 29: Invoke super from within Class Hooks Item 30: Prefer define_method to method_missing Item 31: Know the Difference Between the Variants of eval Item 32: Consider Alternatives to Monkey Patching Item 33: Invoke Modified Methods with Alias Chaining Item 34: Consider Supporting Differences in Proc Arity Item 35: Think Carefully Before Using Module Prepending Chapter 6: Testing Item 36: Familiarize Yourself with MiniTest Unit Testing Item 37: Familiarize Yourself with MiniTest Spec Testing Item 38: Simulate Determinism with Mock Objects Item 39: Strive for Effectively Tested Code Chapter 7:Tools and Libraries Item 40: Know How to Work with Ruby Documentation Item 41: Be Aware of IRB's Advanced Features Item 42: Manage Gem Dependencies with Bundler Item 43: Specify an Upper Bound for Gem Dependencies Chapter 8: Memory Management and Performance Item 44: Familiarize Yourself with Ruby's Garbage Collector Item 45: Create Resource Safety Nets with Finalizers Item 46: Be Aware of Ruby Profiling Tools Item 47: Avoid Object Literals in Loops Item 48: Consider Memoizing Expensive Computations Epilogue Index · · · · · · () |
细腻厚实
细细品吧~
很独特的视角
中了毒,根本停不下来