Online Library TheLib.net » Ruby Best Practices
cover of the book Ruby Best Practices

Ebook: Ruby Best Practices

Author: Gregory T Brown

00
27.01.2024
0
0
3 stars - the book as it stands
5 stars - the book how it WILL be

Gregory Brown was gracious enough to offer his book FREE on his blog as an open-source project!

(Amazon edits out the URL, please just Google for it)

David Flanagan and Yukihiro Matsumoto's book "The Ruby Programming Language" was much more useful for me honestly, but "TRPL" is certainly not open-source!

My gripes for "Ruby Best Practices" include:
* Missing design patterns applications (eg, how to implement the Strategy pattern using Proc or Method objects; Singleton was actually discussed on pp. 72-74 but could be more explicit)
* Any exception handling best practice advice, besides what's touched on in Chp. 1?
* Should be in cookbook format
* Summarize Ruby's best idioms (the one on p. 257 with [:month, :day, :year, :hour, :minute, :second].map { |attr| dtime.send(attr)} was kind of neat)
* Summarize Ruby's naming conventions and known anomalies
* Performance considerations? Even "TRPL" touched on what's fast and slow in Range membership tests for example, for both Ruby 1.8 and 1.9
* Module objects used as a namespace mechanism, any best ways or distilled advice, besides what's touched on p. 133?
* Summary of corner-case gotchas of Ruby syntax? (eg, when parentheses are required for method invocations, as covered in "TRPL")
* XML processing could be better other than what's in Chp. 1 (with the Nokigiri module) Comparison of modules would be great
* Any Perl-ish Unix filter best practice advice? (ala Tim Maher's "Minimal Perl")
* DSL advice?
* Any install-specific advice, what's the best and most flexible configuration for production for example? (ie, environment variables, proper location according to Linux FHS, and so on) How about Mac OS X or Windows installs?
* Brief Rails best-practices section would be nice, but that's probably pushing it ;)
* Some Factory methods best practices?
* C extensions best practices?
* Ruby 1.8.6 syntax left behind, and was not mentioned on book front or back cover (where it should be), though it's in the Preface. There's an Appendix that touches on some 1.8.6 migration issues however (Ruby 1.9.1 and beyond are the future I agree, but 1.8 is still being distributed for Mac OS X and Debian GNU/Linux at the time of this writing)
* Some so-so advice:
Eg:
....so-so: "I'm not generally a big fan of logfiles." (p. 168)
....so-so: author shows that /[0-9][0-9][0-9][0-9]/ can be rewritten as /d{4}/ (p. 105)
....so-so: Chapter 2 Designing Beautiful APIs - most of this material already covered in D. Flanagan/Matz' book

Appendix B. Leveraging Ruby's Standard Library was the most useful part of the book for me. (I find it to be the most accessible! Most of the other content is just too buried in prose.)

A cookbook or "Power Tools" format can benefit this book IMHO. Mike Loukides (editor) should've seen this beforehand I think (Mike was one of the authors of the venerable "Unix Power Tools.")

Gregory - big thanks to you and O'Reilly for open-sourcing your book!
Download the book Ruby Best Practices for free or read online
Read Download
Continue reading on any device:
QR code
Last viewed books
Related books
Comments (0)
reload, if the code cannot be seen