Programming Ruby

Dave Thomas, Chad Fowler, Andy Hunt

出版时间

2004-10-08

ISBN

9780974514055

评分

★★★★★
书籍介绍
这本书在读者口中有一个绕不开的名字——'Pickaxe'(斧头)。它被许多人当作Ruby的权威参考,但争议也由此而来:有人称它是'good read for ruby'的入门良师,也有人抱怨它'有点厚了''是个大全stupid guide',甚至'扫一遍最新版觉得28美元花得不值'。正是这种两极评价,勾勒出它真正的定位——它不是一本可以快速翻完的速成手册,而是一本'要多少个下午才够'的案头工具书。书中对访问控制(public/protected/private的微妙区别)、块变量作用域、类与对象外部状态等细节的拆解,显示出它更像一位耐心讲解语言机理的向导,而非罗列语法清单的字典。如果你愿意花时间去'啃',它会回报以扎实的Ruby理解;若只想快速上手,它或许会让你觉得沉重。
AI导读
核心看点
  • Ruby权威参考书,涵盖1.8版本新特性
  • 含教程、语言参考及内置类完整文档
  • 深入讲解元编程与标准库模块用法
读者共识
  • 公认的Ruby入门与参考经典之作
  • 内容详尽但篇幅较长,阅读有压力
  • 适合边学边查,是案头必备手册
精彩摘录
  • "A subprocess changes an environment vari- able, and this change is inherited by a process that it then starts. However, the change is not visible to the original parent. (This just goes to prove that parents never really know what their children are doing.)"
  • "When you design a class, you decide what internal state it has and also decide how that state is to appear on the outside (to users of your class). The internal state is held in instance variables. The external state is exposed through methods we’re calling attributes. And the other actions your cla"
  • "Ruby gives you three levels of protection: • Public methods can be called by anyone—no access control is enforced. Methods are public by default (except for initialize, which is always private). • Protected methods can be invoked only by objects of the defining class and its sub- classes. Access is "
  • "Block: First, parameters to a block are now always local to a block, even if they have the same name as locals in the surrounding scope. (You’ll get a warning message if you run Ruby with the -w option.)"
  • "Second, you can now define block local variables by putting them after a semicolon in the block’s parameter list. So, in our sum-of-squares example, we should have indicated that the square variable was block-local by writing it as follows:"
  • "use braces for single-line blocks and do/end for multiline blocks."
  • "方法是通过向对象发送消息来唤起调用的。消息包含方法名称以及方法可能需要的参数。当对象接收到一条消息时,它在自己的类中查找相应的方法。如果找到了,该方法会被执行。"
  • ""protected"和"private"之间的区别很微妙,并且和其他大多数普通的面向对象语言都不同。如果方法是保护的,它可以被定义了该方法的类或其子类的实例所调用。如果方法是私有的,它只能在当前对象的上下文中被调用------不可能直接访问其他对象的私有方法,即便它与调用者都属同一个类的对象。"
用户评论
这个假期必须读完,已经拖了好久了
good read for ruby
一般,讲的清楚但不深入,适合做入门书
ruby真是挺好玩的,又好看。
非常好.
讲解顺序太奇葩...并不适应...但还是很全面的,毕竟bookshelf.
据说Ruby是最好的动态语言,甩第二名lisp好几条街;然而对于这本书而言,个人佩服作者水平,Ruby个中要点娓娓道来,然而这本书决然不是写给不会Ruby的人看的,或者说对未曾研究过动态编程语言的读者而言确实有点儿"柴"。
思路不够清晰,并不是特别适合有点基础的初学者。
学习ruby基础操作,通过此书可以很快对ruby on rails,上手开发简单的web应用。
Pragmatic Bookshelf的其他书籍查看全部

下载
收藏