Home Page Icon
Home Page
Table of Contents for
Acknowledgments [This content is currently in development.]
Close
Acknowledgments [This content is currently in development.]
by Peter Jones
Effective Ruby: 48 Specific Ways to Write Better Ruby
Table of Contents
Preface [This content is currently in development.]
Acknowledgments [This content is currently in development.]
About the Author [This content is currently in development.]
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
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
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
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
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
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
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
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
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Preface [This content is currently in development.]
Next
Next Chapter
About the Author [This content is currently in development.]
Acknowledgments [This content is currently in development.]
This content is currently in development.
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset