Programming Ruby中文版

托马斯

出版时间

2007-02-28

ISBN

9787121038150

评分

★★★★★

标签

web编程

书籍介绍
这本书在读者中引发的评价两极分化,恰恰揭示了它的真实定位:它不是一本适合零基础者“一个下午”速成的入门书,而更像一部供反复翻阅的参考典籍。不少读者从学习Rails的过程中回头啃Ruby,最终选定它,理由是“深入浅出”、值得手边常备;也有人嫌它过于庞厚,认为在Google和ri文档唾手可得的时代,罗列数百页API显得多余。正因如此,它的价值不在于速成,而在于系统性与可查性:类与访问控制、Blocks和迭代器的运作机制、正则匹配的细节,都是实践中真正用得上的硬核内容。反复重读仍能“总有新发现”的反馈,说明它经得起当作工具书长期倚重。适合已有一定编程经验、希望扎实掌握Ruby语言机制并需要一本可靠手册的读者。
AI导读
核心看点
  • 本书是Ruby语言权威指南,涵盖Ruby 1.8特性及标准库,提供从入门到高级特性的全面讲解,包括面向对象、正则表达式、异常处理等核心内容,适合作为日常编程参考手册。
  • 深入解析Ruby的面向对象特性,如类、模块、继承、访问控制等,强调Ruby作为动态类型语言的安全性与灵活性,帮助读者理解Ruby设计哲学与最佳实践。
  • 提供大量实用代码示例与API文档,涵盖文件操作、网络编程、多线程等系统级功能,但需注意版本限制,当前内容不适用于Ruby 1.9及以上版本,建议结合官方文档学习。
读者共识
  • 读者普遍认为本书结构严谨、内容详实,是Ruby语言的重要参考资料,但因其版本过时、翻译质量参差,已不适合作为当前学习Ruby的首选教材。
  • 多数读者指出本书不适合初学者,因其缺乏教学引导且假设读者具备编程基础,仅适合有经验的开发者作为API查阅工具,且需警惕版本兼容性风险。
  • 尽管存在版本与翻译问题,部分读者仍认可其历史价值,认为书中对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"之间的区别很微妙,并且和其他大多数普通的面向对象语言都不同。如果方法是保护的,它可以被定义了该方法的类或其子类的实例所调用。如果方法是私有的,它只能在当前对象的上下文中被调用------不可能直接访问其他对象的私有方法,即便它与调用者都属同一个类的对象。"
目录
第1版序
第2版序
前言
路线图
第1部分 Ruby面面观

显示全部
用户评论
花了几天通读了一下,不过里面很多东西都没有全部理解,仅仅是过了一遍,以后需要使用的时候再仔细看某一部分吧。
书里的组织结构很好
一颗星扣在翻译上,我个人认为此书弄个电子版配合英文版看看即可,越看越觉得翻译的不好。一星扣在版本上。现在ruby1.9了都,此书才1.8。英文版的章节已经和此版部分不一样,而且内容也有改动。
ruby开发者案头必备
:TP393.09/5074
很不错的一本书,兼具深度、广度,体现了Ruby的灵活、优雅。就是后半部分讲的是各种库,有意思吗?日常又不可能把所有的库都用上。而且就算要用,想看那些库的资料,直接上网找文档了,又新又全。那些感觉是作者骗字数的。🤨
看了第一部分,主要是为了读懂msf的攻击脚本
入门推荐此书 容器、block 和迭代器是ruby 的核心概念。
镐头书,看的挺费劲的当时
入门级别的书,有的地方讲的不是很清楚。不过中文里没有别的书更好了
求书
收藏