Effective Ruby

Effective Ruby pdf epub mobi txt 电子书 下载 2025

出版者:Addison-Wesley Professional
作者:Peter J. Jones
出品人:
页数:240
译者:
出版时间:2014-10-5
价格:USD 39.99
装帧:Paperback
isbn号码:9780133846973
丛书系列:
图书标签:
  • Ruby
  • 计算机
  • 编程
  • 技术
  • Programming
  • 2015
  • Ruby
  • 编程
  • 开发
  • 技巧
  • 最佳实践
  • 代码质量
  • 软件工程
  • 设计模式
  • 性能优化
  • 可读性
想要找书就要到 图书目录大全
立刻按 ctrl+D收藏本页
你会得到大惊喜!!

具体描述

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 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 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 Gem dependencies

How to make the most of Ruby’s memory management and profiling tools

How to eliminate code ambiguities that make Ruby incorrectly guess your intentions

How to improve code efficiency by understanding the Ruby interpreter’s internals

作者简介

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.

目录信息

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
· · · · · · (收起)

读后感

评分

评分

评分

评分

评分

用户评价

评分

Great insights in the *effective* style.

评分

Great insights in the *effective* style.

评分

大部分内容都在官方文档和通用编程书上见识过了啊。

评分

还是effective的味儿,只是这本书定位微妙。有别的编程语言基础的话,这本书的前四章基本可以速读过;后面的内容虽然更加针对Ruby但是又缺些深度。不过48条里面还是能找到不少实用度高的gems的,用来快速ramp up还行。

评分

最近一直只读不写也是... 唉...

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2025 book.wenda123.org All Rights Reserved. 图书目录大全 版权所有