书名:Metaprogramming RubyProgramLiketheRubyPros
作者:PaoloPerrotta
译者:
ISBN:9781934356470
出版社:PragmaticBookshelf
出版时间:2010-2-22
格式:epub/mobi/azw3/pdf
页数:296
豆瓣评分: 9.4
书籍简介:
Everyone in the Ruby world seems to be talking about metaprogramming–how you can use it to remove duplication in your code and write elegant, beautiful programs. Now you can get in on the action as well. This book describes metaprogramming as an essential component of Ruby. Once you understand the principles of Ruby, including the object model, scopes, and eigenclasses, you're on your way to applying metaprogramming both in your daily work and in your fun, after-hours projects. Learning metaprogramming doesn't have to be difficult or boring. By taking you on a Monday-through-Friday workweek adventure with a pair of programmers, Paolo Perrotta helps make mastering the art of metaprogramming both straightforward and entertaining.
作者简介:
Paolo Perrotta has more than ten years of experience as a developer and writer. He worked for domains ranging from embedded to enterprise software, computer games, and web applications. These days, Paolo coaches agile teams for Yoox, a large Internet fashion shop, and teaches Java to developers throughout Europe. He lives in Bologna, Italy, with his girlfriend and a cat. He loves Ruby.
书友短评:
@ 永远自由的心 看完前四章,大致了解了它的对象模型了。后面的应用部分不看了,反正也不打算用ruby。确实用lua来实现这套模型是可以的(lua根本就没有OO模型…),不过lua没有多少语法糖,调用函数一定要加个(),实现DSL怎么也不如ruby漂亮。其实也不喜欢内部DSL,一来语法受限,不如外部DSL使用parser的灵活,二来牺牲了运行效率,没法对代码做静态检查和优化。用外部DSL就可以兼顾两者,虽然实现起来麻烦一些 @ kevinclcn 将Ruby元编程的各种刁钻技巧总结成了规范的模式,就像让混沌的世界变得泾渭分明。这种化繁为简和清晰有条理本身就是一种莫大的功勋。 @ Fisherchenxi 不错,不过我觉得Ruby的单件类设计颇有尾大不掉之感,我最近实现的类ruby语言没有按这个来。 @ Jonham 接触到Meta编程的思考。后边才有了Python中的__missing__的使用。才有了JS里,动态创建key。才有了对LISP的囫囵吞枣。才有了对scheme的试用。 @ lihuichaoo 两年前读过了,帮助自己系统建立了ruby基本知识。 @ 白乌鸦 再读一遍 @ 五好幼儿 A programming book that doesn't affect the way you think about programming, is not worth reading ???
添加微信公众号:好书天下获取
评论前必须登录!
注册