書籍紹介『プログラミング Ruby 第 2 版 (言語編・ライブラリ編)』

編集:ささだ

書籍紹介『プログラミング Ruby 第 2 版 (言語編・ライブラリ編)』

『プログラミングRuby 第 2 版 言語編』

著者
Dave Thomas, with Chad Fowler and Andy Hunt
まつもと ゆきひろ (監訳) 田和 勝 (訳)
定価
3990 円 (本体 3800 円+税)
版形
B5 変
ページ数
434 頁
関連 URL
http://www.amazon.co.jp/gp/product/4274066428
http://ssl.ohmsha.co.jp/cgi-bin/menu.cgi?ISBN=4-274-06642-8

『プログラミングRuby 第 2 版 ライブラリ編』

著者
Dave Thomas, with Chad Fowler and Andy Hunt
まつもと ゆきひろ (監訳) 田和 勝 (訳)
定価
4410 円 (本体 4200 円+税)
版形
B5 変
ページ数
416 頁
関連 URL
http://www.amazon.co.jp/gp/product/4274066436/
http://ssl.ohmsha.co.jp/cgi-bin/menu.cgi?ISBN=4-274-06643-6

紹介

本書は、定評がある Ruby の解説書を、Ruby の作者まつもとゆきひろ氏自身の監訳で翻訳したものです。

日本語版は言語編とライブラリ編の 2 分冊になっており、それぞれの内容は次のとおりです。

言語編

言語自体のチュートリアルです。Ruby の基礎や独特の用語・概念、使い方に関する実用的な情報、拡張ライブラリの作成方法から、文法と内部動作の仕組みといった少し高度な内容まで解説しています。

ライブラリ編

Ruby のクラスライブラリのリファレンスです。48 を超える組み込みクラス/モジュールの 950 を超えるメソッドについて解説しています。Ruby のディストリビューションに含まれる標準添付ライブラリも紹介しています。

著者・翻訳者からのコメント

Dave Thomas 氏からのコメント (原文)

Q.1 What are the must-see highlights of the book? (comprehensibility, depth, etc.)

This is really two books in one. The first part is a tutorial on Ruby, and the second half is an in-depth reference on the language and its libraries.

I’m very proud of both halves. The tutorial was an experiment for us. Most tutorials for programming languages start by saying “this is a variable, these are the data types, this is an ‘if’ statement and so on.” They build from the bottom up. But I felt that this missed the whole flavor of the Ruby language: Ruby is a wonderfully integrated whole. So in Programming Ruby we took the opposite approach: we started with classes and objects, and the filled in the details later—we described the language from the top down (or maybe from the middle out, depending on your perspective). I was nervous about doing this at the time, but it seems to have worked—people say they really like this approach.

I’m proud of the reference material for a different reason. Most of the Ruby library code was not documented when we first wrote Programming Ruby. So to work out what each method did, we read the code. So that reference section is as accurate as we can make it because it’s based on the real source of Ruby.

Q.2 Where did you put your most effort on? (Keeping it simple, etc.)

I think the most effort was spent on keeping it at an appropriate level. When we write, we always imagine that our reader is sitting next to us, asking questions. We then try to answer these questions in the text. Because of this approach, we end up doing a lot of rework: we write a chapter, then as we read it through again, questions arise, so we rewrite to answer them. When we read it again, more questions arise, and we rewrite some more. That takes a little time, but I think it’s worth it.

Q.3 Anything you like to tell us (If you have something to say to Japanese Ruby users and potential readers of your book, please let us hear it.)

I am honored that our book on Ruby is now available in the home of Ruby. Japan has a national treasure in Yukihiro Matsumoto, and I’m proud to be associated with his work.

Dave Thomas 氏からのコメント (日本語訳)

Q.1 この本の見どころはどこですか?

これは実際のところ 2 つの本が 1 つになったものなんだよ。最初の半分は Ruby のチュートリアルで、もう半分は言語とライブラリの詳しいリファレンスだ。

どちらの部分についても、私は誇りに思っている。チュートリアルの部分は、私たちにとって実験だった。プログラミング言語のチュートリアルの大半は、こんなふうに始まる:「これが変数で、これがデータ型、これが “if” 文で、……」つまりボトムアップ方式で説明している。でも私は、このやり方ではRuby という言語の香りがうまく伝わらないと思った:Ruby は総体として素晴らしい具合に調和した、ひとつのものなんだ。だから Programming Ruby では、私たちは逆のアプローチをとった:つまりクラスとオブジェクトから始めて、詳しいことは後から補う――トップダウンで言語を解説した (別の言い方をするなら、視点にもよるが「ミドルアウト」だろうか)。当時の私は、そのやり方で本当によかったのか心配だった。でも、どうやらうまくいったみたいだ――みんなこのアプローチが好きだと言ってくれている。

リファレンス部分については別の理由から誇りに思っている。Ruby のライブラリのコードのほとんどは、私たちが当初 Programming Ruby を書いたときにはドキュメントがなかった[#]。そこで、それぞれのメソッドが何をしているのかを調べるために、私たちはコードを読んだ。だから、リファレンス部はできる限り正確なものになっているはずだ。Ruby の実際のソースに基づいているのだからね。

[#] 訳注: 英語のドキュメントが不足していたということかなと思います。

Q.2 最も努力したところはどこですか?

私の考えでは、一番気をつけたのは、適切なレベルを維持することだった。私たちが執筆するときは、いつも、隣に読者が座っていてあれこれ質問してくるところを頭に思い浮かべる。そしてその質問に対する答えを、テキストとして書く。このアプローチのせいで、大量の書き直しが必要になった。1 章分の原稿を書き上げて、もう一度読んでみるうちに、疑問がいくつも生じて、そうなるとそれに答えるために書き直す。もう一度読むと、さらに疑問点が生じて、もうちょっと書き直す。このやり方はちょっと時間がかかるけれども、私はやる価値があると信じている。

Q.3 ほかに何かあればどうぞ

とうとう Ruby の故郷で私たちの Ruby の本の第 2 版が手に入るようになったのは、光栄なことだ。日本には、まつもとゆきひろさんという国の宝があり、私は彼の作品と自分の関係を誇りに思う。

どうも!

まつもと氏からのコメント

Q1. この本の見どころ

とうとう二分冊になってしまうほどのボリューム。しかも、学習書としてもリファレンスとしても役立つ便利な構成。二分冊になってかえって使いやすいかもしれません。

Q2. 一番力を注いだところ

原著の間違いの修正も含めて正確さ。これ以上見落としがないとよいのですが。

Q3. その他、序文等に書けなかった話があれば

英語のユーモアを翻訳するのはほんとうに大変です。文化的違いを乗り越えていくばくかは日本の読者にも伝わればよいのですが。