Ruby程序员修炼之道(第2版)

David A. Black

出版时间

2016-10-10

ISBN

9787115405036

评分

★★★★★
AI导读
核心看点
  • 专为Rails程序员优化的Ruby进阶指南
  • 深入讲解动态特性与元编程机制
  • 涵盖语法、OOP及内置类核心知识
适合谁读
  • 具备基础编程经验的Ruby开发者
  • 希望深入理解Ruby底层机制的工程师
  • 从事Rails开发需优化代码的程序员
读前提醒
  • 中文翻译质量参差不齐,建议参考原版
  • 非零基础入门书,需有一定编程基础
  • 重点阅读后半部分动态编程章节
读者共识
  • 内容深入浅出,是Ruby学习佳作
  • 翻译生硬且存在误译,阅读体验打折
  • 适合作为工具书查阅,部分章节晦涩

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "A method that you define at the top level is stored as a private instance method of the Object class. Defining private instance methods of Object has some interesting implications. First, these methods not only can but must be called in bareword style. Second, private instance methods of Object can "
  • "A protected method is like a slightly kinder, gentler private method. The rule for pro- tected methods is as follows: you can call a protected method on an object x, as long as the default object (self) is an instance of the same class as x or of an ancestor or descendant class of x’s class. This ru"
  • "If you declare dog_years= private, you can call it with a receiver—as long as the receiver is self. It can’t be another reference to self; it has to be the keyword self."
  • "Constant lookup—the process of resolving a constant identifier, finding the right match for it—bears a close resemblance to searching a filesystem for a file in a particular directory. For one thing, constants are identified relative to the point of execution. the :: in front of a constant means “st"
  • "When the Ruby parser sees the sequence identifier, equal-sign, value, as in this expression x = 1 it allocates space for a local variable called x. The creation of the variable—not the assignment of a value to it, but the internal creation of a variable—always takes place as a result of this kind of"
  • "Every Ruby object has a case equality method called === (three equal signs, sometimes called the “threequal” operator). The outcome of calling the === method determines whether a when clause has matched."
  • "Blocks, in other words, have access to the variables that already exist when they're created. However, block parameters (the variable names between the pipes) behave differently from non-parameter variables. If you have a variable of a given name in scope and also use that name as one of your block "
  • "Coming full circle, remember that nil has a boolean value of false. nil and false are the only two objects that do. They’re not the only two expressions that do; 100 < 50 has a boolean value of false, because it evaluates to the object false. But nil and false are the only two objects in Ruby with a"
目录
第一部分 Ruby语言基础 阅读
第1章 进入Ruby的世界 阅读
第2章 对象、方法和局部变量
第3章 使用类组织对象
第4章 模块和程序组织

显示全部
用户评论
翻译一般
非常有用的工具书
电子书;网盘;Ruby;
一定要去看英文原版😅这书的中文翻译简直是烂而且误译的地方很多,第二译者应该真的只是挂名吧
读一遍才安心
翻译略显生硬
得于Ruby Summit 2018(郑州)。并不像入门读物,因为一开头的章节有点妖,中间又有点像特性介绍。尽管如此,尽管读过Ruby元编程和Ruby原理剖析,但读这本书还是有收获,最后三章举例子讲动态和元编程,有很多启发,比如call_original和method_added。[1909]
下载
收藏