<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:series="http://organizeseries.com/"
> <channel><title>RubySource</title> <atom:link href="http://rubysource.com/feed/" rel="self" type="application/rss+xml" /><link>http://rubysource.com</link> <description>RubySource provides advice, tutorials, commentary, and insight into the Ruby and Rails ecosystem.</description> <lastBuildDate>Mon, 17 Jun 2013 15:27:52 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <item><title>Meet Fifteen Ruby Core Committers</title><link>http://rubysource.com/meet-fifteen-ruby-core-committers/</link> <comments>http://rubysource.com/meet-fifteen-ruby-core-committers/#comments</comments> <pubDate>Mon, 17 Jun 2013 13:30:36 +0000</pubDate> <dc:creator>Pat Shaughnessy</dc:creator> <category><![CDATA[Interviews]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5788</guid> <description><![CDATA[We all know Yukihiro Matsumoto invented Ruby, but how many of the other people behind Ruby can you name? Judging from this photo taken just a few weeks ago at RubyKaigi 2013, the Ruby 2.0 release was a real team effort, with&#8230;]]></description> <content:encoded><![CDATA[<p>We all know Yukihiro Matsumoto invented Ruby, but how many of the other people behind Ruby can you name? Judging from this photo taken just a few weeks ago at <a
href="http://rubykaigi.org/2013">RubyKaigi 2013</a>, the Ruby 2.0 release was a real team effort, with commits both from the people on stage in Tokyo and hundreds of other open source developers located around the world.</p><p><img
alt="" src="http://cdn.rubysource.com/files/2013/06/ruby-kaigi-stage2.jpeg" /></p><p>However, many of the most active developers behind the Ruby 2.0 release are Japanese, largely unknown to the Ruby world outside of Japan because of the language barrier. Recently I asked the Ruby 2.0 release manager, Yusuke Endoh, to send a few questions to the Ruby 2.0 committers located in Japan. I was curious who they were, what each of them worked on and what they’re like as people. Fourteen other developers replied to his survey; read on to take a look behind the language barrier and meet some of the people in Japan behind this year’s Ruby 2.0 release.</p><p><b>Update:</b> We just received answers from one more Ruby committer. Now there are sixteen of them :)</p><p></p><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/yusuke-endoh.jpeg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Yusuke<br
/> Endoh</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself and how you became involved with Ruby?</p><p>I&#8217;m Yusuke Endoh, one of the Ruby committers. I was a release manager during the Ruby 2.0.0 release. Also, I was an assistant release manager for Ruby 1.9.2. I used to help the committers test and debug Ruby, just for fun. Then, some committers recommended me for the commit bit. But I didn&#8217;t become a committer right away. But after 1.9.1 was released, I saw chaos: bugs reported one after the other right up until the release day, and committers racing to fix them. It seemed like they enjoyed the chaos. To help avoid chaos for the next release, I became a committer. But unfortunately, the releases of 1.9.2 and 2.0.0 were less chaotic than 1.9.1.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>Ruby のコミッタの一人です。 Ruby 2.0.0 の際はリリースマネージャをやっていました。 Ruby 1.9.2 の時はリリースマネージャ補佐をやっていました。 元々は単なる遊びとして、Ruby のバグ出しやデバッグを手伝ってました。 すると何人かのコミッタがコミット権を持つように勧めてくれました。 でもメリットが分からなかったので、すぐにコミッタになることはありませんでした。 そうするうちに、1.9.1 のリリースでカオスを見ることになりました。 当日までバグが次から次と報告され、 多くのコミッタが競い合ってバグを修正していました。 彼らはそのカオスを楽しんでいるように見えました。 次のカオスに参加するため、私はコミッタになりました。 しかし残念ながら、1.9.2 と 2.0.0 のリリースは 1.9.1 ほどカオスではありませんでしたね。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us who the Ruby core committers were during the Ruby 2.0 release? I think most people outside of Japan are probably not familiar with any team members other than Yukihiro Matsumoto.</p><p>There’s no good way to define the group &#8220;core committers&#8221; or &#8220;core team.&#8221; I guess this is because Matz hates bureaucracy so much.</p><p>I looked for people on ruby-dev (a Japanese Ruby developers mailing list) who identify themselves as &#8220;a very core committer&#8221; and collected answers from them. Though the list is far from exhaustive I think all of them are great hackers and core committers.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 2.0 の際の Ruby コアコミッタが誰だったか教えて頂けますか？ 日本人以外の多くの人は、おそらくまつもとゆきひろ以外のチームメンバをよく知らないと思います。</p><p>前述の通り、&#8221;core committers&#8221; とか &#8220;core team&#8221; というような集団は規定されていません。 matz は官僚主義を嫌っているので、このようなチームを明確に定義することは今後もないと思います。 ある意味では matz のみが core committers と言えます。</p><p>そこで今回は、ruby-dev (日本語の Ruby 開発者メーリングリスト上) で、 「我こそはコアコミッタだ」と思う人に呼び掛けて回答を集めてみました。 このリストは網羅的からはほど遠いですが、 少なくとも彼らは全員すばらしいハッカーで「コアコミッタ」だと思います。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>During the 2.0.0, I was a release manager. I did miscellaneous tasks for facilitating the release: planning, progress and issue management, off-line/on-line meetings, announcement, packaging and releasing, and ex-post assessment.</p><p>You can read about the release in an English article I wrote in <a
href="http://jp.rubyist.net/magazine/?Ruby200SpecialEn-release">Rubyist Magazine</a>.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>2.0.0 の際はリリースマネージャでした。 リリースを促進するための雑務として、 計画策定、進捗とバグの管理、オフライン・オンラインの会議、 アナウンス、パッケージとリリース、そして反省会です。</p><p>リリースの経緯については <a
href="http://jp.rubyist.net/magazine/?0041-200Special-release">Rubyist Magazine の記事</a> もご覧ください。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px;text-align:right;padding-top: 97px"> <i>A portrait of me that my wife painted.<br
/> 私の妻が書いてくれた似顔絵。</i></div><div
style="float: left;width: 260px;margin: 10px"> <img
alt="" src="http://cdn.rubysource.com/files/2013/05/mame2.png" /></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>My hobby in programming is writing a Quine and enjoying esoteric programming. Recently I&#8217;m happy about winning two awards at <a
href="http://www.ioccc.org/2012/whowon.html">IOCCC 2012</a>.</p><p>My hobby is walking; I&#8217;ve walked with my wife along almost all railways (about 4,200+ km total) in the Kanto region of Japan.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>プログラミングに関する趣味は、Quine を書いたり、難解プログラミングを楽しんだりすることです。最近 IOCCC 2012 に 2 作品入賞したのがちょっと嬉しいです。</p><p>プログラミング以外の趣味はウォーキングです。妻といっしょに日本の関東地方の鉄道路線沿線 (合計約 4,200 km 以上) を歩きました。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/nobuyoshi-nakada.jpeg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Nobuyoshi<br
/> Nakada</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I&#8217;m a programmer and a house husband. I live with my wife and 3 daughters.</p><p>Like other old-timers, Perl 5 didn&#8217;t feel right to me, and then I found a couple bugs in Ruby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>兼業主夫プログラマ、妻と娘三人。</p><p>他の古顔同様、Perl 5で残念な気持ちだったところに、Rubyのバグを見 つけてしまったから。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>Fixing bugs, implementing new features and new bugs.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>バグを直したり、新機能や新バグを追加したりとか。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>Hot air ballooning.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>熱気球。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/tanaka-akira.jpeg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Akira<br
/> Tanaka</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I first used Ruby when my program needed multiple threads and data structures. Before that I used Perl 4, but it was not suitable for these problems.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>スレッドとデータ構造が必要になったときに Perl4 から Ruby に移行しました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I developed or maintained (part of) several libraries such as pathname, resolv, open-uri, pp, securerandom, tsort, time, socket, io, process, encoding, transcode, etc.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>いろいろやってます。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>I like to work on API Design and portability among various operating systems.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>API デザインとか、ポータビリティとか。</p></div><p></p><div
style="clear: left"></div><h2>Yui Naruse</h2><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I&#8217;m the release manager of the upcoming Ruby 2.1.0 release. I wrote a chat/bbs system in CGI/Perl, but later I wanted a programming language which I could use to write programs more clearly. After trying different languages I chose Ruby, but it didn&#8217;t have some functionality like character encoding conversion. Therefore I decided to participate in the development of Ruby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>Ruby 2.1.0 のリリースマネージャになった成瀬です。 もともとCGI/Perlでチャットや掲示板を書いていたんだけど、OOP-Perl のコレジャナイ感が強かったので、いちばんよさげなRubyに乗り換えたものの、文字コード変換機能が足りなかったので (SJIS/EUCからUTF-8へのMS風変換ができなかった)、開発に参加することにしました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I first joined the Ruby project as the maintainer of ext/nkf, which converts text encoding. In Ruby 1.9 I worked around M17N (multilingualization). Now I&#8217;m working in various areas, mainly platform dependent issues of CRuby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>まず、ext/nkfのメンテナになり、Ruby 1.9 で M17N 周りを中心に CRuby に関わるようになりました。今は CRuby の様々な部分、特に環境依存な部分を直しています。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>Normal Japanese liberal arts: World History, MMORPG, Anime, and Eroge.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>日本における一般的な教養であるところの世界史、ネトゲ、アニメ、エロゲをたしなんでおります。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/usaku-nakamura.jpg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Usaku<br
/> Nakamura</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I&#8217;m a maintainer of the Windows versions of Ruby; I ported Ruby to mswin64; and I&#8217;m also the branch maintainer of Ruby 1.9.3. At the office, I&#8217;m a poor business man who wants to be a programmer but instead is forced to be a manager.</p><p>I discovered Ruby at the end of the last century. One day I wanted to rewrite a hobby Perl script because it had become spaghetti code. I thought that the script was object oriented, but I disliked the way Perl 5 implemented OOP. So, I looked for another programming language and found Ruby. When I started to use Ruby on Windows, it often crashed. So I sent some patches to ruby-dev mailing list. Later, Matz asked for some help maintaining Ruby on Windows, and I volunteered naturally.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>Windows版Rubyメンテナ(主としてmswin担当)、mswin64移植者、1.9.3 ブランチメンテナ。 職場では、開発者でありたいけれどマネージャー的な仕事を強要されている 不幸なサラリーマンです。</p><p>Rubyと関わるようになったのは20世紀末。 Perlで書いていた趣味スクリプトがスパゲッティ化してきたので書き直したく なり、オブジェクト指向で設計するとよさそうに思えたのだけれど、Perl5の オブジェクト指向機能は使う気になれなかったので代替の言語を探したらRubyが 見つかった。 Windowsで使おうとしたらいきなりクラッシュしたのでパッチを送ったりして、 その後何かの折にmatzがWindows版のメンテナを募集したので手を挙げたら こうなった。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I fixed many bugs on the Windows platform (and wrote new bugs too&#8230;). I also ported Ruby to the 64bit version of Windows. I also maintain the Ruby 1.9.3 branch.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>Windows版Rubyのバグを延々と直したり(そしてバグを入れたり)、 64bit WindowsにRubyを移植したり、 業務として1.9.3ブランチのメンテナをしたり、</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>Maybe unlike Matz, I like learning about various programming languages. My favorite languages other than Ruby are C and C#. Outside of programming, I like watching shogi games. I think shogi is more intersting than chess!</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>matzほどじゃないけどいろんなプログラミング言語をいじるのが好き。 Ruby以外でお気に入りの言語はC、C#。 プログラミング以外では将棋を観るのが好き。チェスより面白いよ!</p></div><p></p><div
style="clear: left"></div><h2>Hirofumi Watanabe</h2><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>My account handle is eban. I mainly play a background role for managing the development environment: automatic updating version.h, management of the mailing list, svn hooks (such as commit mail), etc.</p><p>Before getting involved with Ruby, I ported Perl to DJGPP (MS-DOS). I sort of applied the same work to Ruby, and sent a patch to the mailing list. What I wanted to do was just porting; I was not interested in Ruby at first. But the existence of p method motivated me to continue Ruby. In a sense, I didn&#8217;t care about the object-oriented aspects of Ruby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>アカウント名はeban、version.hの自動更新、MLの管理、svnのhook回り(commit mail等)、主に裏方隠居の身。</p><p>きっかけはPerlをDJGPP(MS-DOS)対応したついでにRubyでもやってみるかと思い、 MLにいきなりパッチを投げた。移植したかっただけでRuby自体には当初興味はなかった。 でもpメソッドの存在を知り続けようと思った。オブジェクト指向はある意味どうでもよかった。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I ported Ruby to DJGPP, Cygwin, MinGW, BOW(BSD On Windows), and support cross-compilation. In a sense, my work is almost done once make is passed. I created ftools.rb, jcode.rb, Win32API, un.rb, &#8220;m&#8221; of pack/unpack, instruby.rb, though the first three are no longer in use. I also created the automatic update mechanism for version.h.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>DJGPP, Cygwin, MinGW, BOW(BSD On Windows)への移植、クロスコンパイル対応。 どっちかというとmakeできた時点でほぼ仕事が終了というような領域。 ftools.rb、jcode.rb、Win32API、un.rb、pack/unpackの&#8221;m&#8221;、instruby.rbを作成。 最初の3つはすでに用済み。 version.hの自動更新の仕組みを作った。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>awk, sed, perl, shell script, code golf, etc.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>awkとかsedとかperlとかshell scriptとか、code golfとか。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/koichi-sasada.jpg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Koichi<br
/> Sasada</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I&#8217;m Koichi Sasada, in Matz&#8217;s team at Heroku since 2012. Before joining Heroku, I was on the faculty of the University of Tokyo. My first Ruby application was Rava, a Java virtual machine implementation in Ruby (joke soft). The Ruby Hacking Guide by Minero Aoki is my guide for hacking Ruby&#8217;s implementation.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>笹田耕一と言います。2012 年から、Heroku, Inc. の Matz team に在籍してい ます。Heroku に入る前は、大学で教員をしていました。 私の最初の Ruby アプリケーションは、Rava という Ruby による Java 仮想マ シンの実装でした（ジョークソフトです）。青木峰郎さんによる「Ruby ソース コード完全解説」（通称 RHG）によって、Ruby 自体の実装に興味を持ちました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I developed YARV: Yet Another RubyVM. When I began working on YARV in 2004, there were several other ruby virtual machines intended to replace CRuby. This is why I named it &#8220;Yet Another.&#8221; Later later YARV was merged into CRuby starting with Ruby 1.9.0. I&#8217;m working on Ruby core improvements, such as VM tuning, introducing a new GC algorithm, RGegGC, and so on.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>2004 年から YARV: Yet Another RubyVM を作りはじめ（開発開始時には、ほか にいくつか VM があったので Yet Another としました）、Ruby 1.9.0 で取り込 まれました。 今は、コア部分の改善を行っております。たとえば、VM のチューニングや GC アルゴリズムの改善（最近、RGenGC というものを議論中）などです。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>Making a good environment, including both computer environments and real house environments. (I just moved into a new house recently!)</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>環境をよくすることに興味があります。計算機環境はもちろんですが、実際の住 環境をいじることにも興味があります（最近引っ越したので）。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/akinori-musha.jpeg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Akinori<br
/> Musha</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I think I&#8217;m best described as a web developer, using Rails and Padrino as well as some Perl for maintaining legacy applications at work. I&#8217;m a maintainer of nokogiri and mechanize, and the author of the gems like webrobots, domain_name and http-cookie. Follow me on GitHub to track my activity.</p><p>I have been a hobby programmer since I was like nine who played with his dad&#8217;s small pocket computer. In mid &#8217;90s when I was a student, I wrote a web-based chat system in Perl4 to communicate with my friends online, and it was pretty successful both as a service and a product. However, I suffered a tough experience in rewriting it in Perl5, which had only just debuted at the moment. The OO features were clumsy, the interpreter was slow in performance and unstable in every corner case I ran into. While I liked the idea of a scripting language meets OOP, Perl5 at that time was just half-baked and premature. This was how I started dreaming of a decent OO scripting language that is designed from ground up.</p><p>I first heard of the name of Ruby in a Japanese Java community, where it was starting to become hot among hard core OO fans and researchers. Matz often dropped by the mailing lists to advertise his new language, which I later got into.</p><p>Ruby was extremely slow at the time compared to C, Java or even Perl in my use cases, but I really loved its syntax and the feature set mixed with the Unix philosophy. It seemed like a familiar yet new world where I could find tradition and future at the same time, and it didn&#8217;t take long before I started to hack on it and join the community to be part of the future.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>一言で表すならWeb開発者だと思います。RailsやPadrinoを使い、仕事ではレガ シーアプリのメンテでPerlを使います。nokogiriやmechanizeのメンテナ‐をやっ ていて、webrobots, domain_name, http-cookieなどのgemの作者です。普段の 活動の様子を見たければGitHubでフォローしてください。</p><p>小学校中学年くらいから趣味でプログラムを書き始めました。親父のポケコン がきっかけです。&#8217;90年代、学生のときに友達とネットで話したくてperl4でウェ ブチャットのシステムを書きました。これはサービスとしても作品としてもあ る程度うまく行ったんですが、これを当時出たてのPerl5で書き直そうとしたら ひどい目に遭いました。オブジェクト指向機能はぎこちないし、性能は出ない し、ちょっと凝った機能を活用しようとすると挙動不審になるし、スクリプト 言語にオブジェクト指向を取り入れるというアイデアは気に入ったんですが、 当時のPerl5はまだ作りかけで未熟な代物だったんです。この経験から、ちゃん と一から設計されたオブジェクト指向スクリプト言語が欲しいなあと思うよう になりました。</p><p>初めてRubyという名前を見たのは日本のJavaコミュニティです。そこではオブ ジェクト指向好きのファンや研究者がRubyに注目しはじめていて、Matzもよく メーリングリストに現れてはその自作言語の宣伝をしていたので、やがて私も Rubyにはまりました。</p><p>そのころのRubyはめちゃくちゃ遅くて、ちょっとした用途でもCやJavaはもちろ んPerlにすら速度面では及びませんでしたが、その文法と機能、それらがUnix 哲学とうまく融合されているところにはとても感銘を受けました。伝統と未来 が同居した、見慣れたけれども新しい世界のように映ったんです。ほどなく Rubyをいじるようになり、自分もその未来の一部になるべく、コミュニティに 参加しました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I have been a Ruby committer since the end of 2000 when I offered myself as a repository administrator to accelerate the development of Ruby. I had some experience in that area as a FreeBSD committer, so I thought I should step forward. Matz accepted my offer, and it became my role to build a secure and functional development infrastructure so we could invite developers of established third party libraries to make Ruby feature complete out of the box. Creating the ruby-cvs mailing list to deploy commit mails, providing each committer with a @ruby-lang.org mail address, introducing a directory/module based access control, and building a repository mirroring (CVSup) server were part of such role.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>私がRubyのコミッターになったのは2000年の終わりで、Rubyの開発を加速する べく、レポジトリ管理者として名乗り出たのがきっかけです。FreeBSDのコミッ ターとしてその辺りの経験を積んでいたこともあり、俺がやってやろうと思い ました。Matzの快諾を受けて、セキュアで機能的な開発インフラ整備に着手し ました。Rubyのディストリビューション単体でたいがいのことができるように、 めぼしいサードパーティライブラリの開発者をRubyの開発に引き込むのが狙い でした。ruby-cvsメーリングリストを作ってコミットメールを流したり、コミッ ター各自に @ruby-lang-org のメールアドレスを付与したり、ディレクトリ/モ ジュール単位でコミット権限を制御したり、レポジトリのミラーリング用サー バ（CVSup）を立てたりといったことです。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>I like playing and watching shogi, the traditional chess of Japan, listening to progressive music and watching American drama series. On weekends, I mostly spend time with my three year old son and wife playing with LEGO, shopping, and hanging out to the park nearby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>将棋を指したり観戦するのが趣味です。あと、プログレッシブ音楽を聴いたり、 アメリカのドラマシリーズを好きで見ています。週末はもっぱら、三歳の息子 や妻と過ごしています。レゴで遊んだり、買い物に行ったり、近くの公園に出 かけたり。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/06/motohro-kosaki.jpg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Motohiro<br
/> Kosaki</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>Hi, my name is Motohiro Kosaki. I am a Linux kernel developer in memory management. I joined the Ruby community about three years ago and I am now one of the top five active committers. Btw, svn is a really great commiter. I can&#8217;t imagine defeating him by commit rate. ;)</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>小崎資広（こさきもとひろ）といいます。主にLinux kernelのメモリ管理の分野の 開発者なんですが、３年ほど前にRubyにjoinしました。さっきここ３年のコミットレート 比較したら今５位ぐらいにいるみたいです。余談ですがsvnさんのコミットレートが高すぎて 倒せません。あいつ人間じゃない</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I am one of the release managers of Ruby 1.9.3 and rewrote GVL at Ruby 1.9.3. I also fixed a lot of thread bugs and race isssues. I am also a Linux platform maintainer and I&#8217;ve fixed several kernel issues for Ruby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>実はここに記載できるようなすごい役割ってまったくしていなくてせいぜい ・1.9.3のときに事実上のリリースマネージャーっぽいことをごにょごにょ ・GVLをまるっと全部書き換え ・スレッドとかタイマースレッドとのレースとか環境・OS依存のバグを直しまくって （もう何直したか思い出せん） ・Linuxプラットフォームのメンテナとしてプラットフォーム固有の問題をハンドル ・たまにカーネルとかglibcを「Rubyに都合が悪いから」という理由で仕様変更させてるとか そんなぐらい？あとはもう思い出せない。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>I spend a lot of time working on improving the Linux kernel. Btw, many people think the job of Linux platform mainainer is easy because Linux has a lot more testers than other platforms, but this is not exactly true. We often need to fix the kernel instead of Ruby for several reasons and this is really tough work. You guys benefit from our kernel contributions if you use Ruby on Linux. :)</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>一応、本職はLinux屋さんなんでLinuxいじってる時間がながいです。みんなさあ、 Linuxプラットフォームメンテナはテスターがいっぱいいて楽だと思ってるみたいだけどさあ、 意外と大変なんだよ。 ちょくちょくカーネル側を直さないといけないはめになって、まあそのオレに都合が悪いから カーネルの仕様変えるぜ系の提案はたいていめんどくさい思いをするのですよ。 そういうわけでバグにぶち当たらずにRubyを使えてる諸卿はもっと各プラットフォームメンテナに 感謝するといいと思うよ</p></div><p></p><div
style="clear: left"></div><h2>Shugo Maeda</h2><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I work for NaCl, where Matz is a fellow, and for the Ruby Association, an organization dedicated to promotion and development of Ruby. When I was a university student, I had implemented a regular expression library for Java, and posted a mail about it to a mailing list for Java developers. On the mailing list someone told me my regular expression library was not object oriented and that I should have looked at Ruby&#8217;s regular expression library. So I learned Ruby, threw Java away, and got involved with Ruby&#8217;s development.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>て所属しているNaClという会社と、 Rubyの普及と発展のための組織であるRubyアソシエーションに所属しています。 大学生の頃にJavaの正規表現ライブラリを書いてJava開発者のためのMLに投稿 したんですが、そのMLで、ある人が私のライブラリがオブジェクト指向的でないから Rubyの正規表現ライブラリを見てみるといいよって指摘してくれたんです。 それでRubyを覚えて、Javaを捨ててRubyの開発に参加することになりました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I&#8217;ve introduced some crazy features such as callcc into Ruby. I&#8217;ve maintained servers for Ruby development, but I don&#8217;t like server maintenance so much, so I&#8217;m glad that Shibata-san can do it instead of me from now on. I&#8217;ve also worked for the standardization of Ruby. It&#8217;s funny that Ruby is now an International Standard ISO/IEC 30170, but I believe Matz wouldn&#8217;t mind breaking the standard if it were necessary for innovation.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>私はcallccなどのいくつかのちょっと変な機能をRubyに導入しました。 Ruby開発のためのサーバのメンテナンスもしてきましたが、サーバのメンテナンス はそんなに好きではないので、これからは柴田さんがやってくれるということで 喜んでいます。 また、Rubyの標準化のための作業もしました。Rubyがいまや国際規格 (ISO/IEC 30170)というのは奇妙な感じがしますが、イノベーションのために 必要であればまつもとさんは規格に反するような変更も厭わないと信じています。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>I&#8217;m interested in functional programming. Apart from programming, I like motorcycles, fishing, and camping.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>関数プログラミングに興味があります。 プログラミング以外では、バイクや釣り、キャンプが好きですね。</p></div><p></p><div
style="clear: left"></div><h2>Kazuhiro Nishiyama</h2><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I live in Osaka. My job is to manage my company&#8217;s server and to develop some small webapps for in-house services by using Rails. I have known about Ruby from NIFTY-Serve, an old Japanese computer communication network. I used to use JPerl to create CGI, for text processing, etc. But I migrated to Ruby because of ease of handling Japanese text. This caused me to be involved with Ruby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>大阪に住んでいて、会社では社内サーバーの管理をしていたり、 社内向けの小規模な Web アプリを Rails で作成したりしています。 Ruby 自体はパソコン通信の NIFTY-Serve のフォーラムで存在自体は知っていて、 CGI を作ったりテキスト処理をしたりするのに JPerl を使っていたのを、 日本語の扱いやすさから、Ruby に移行したのがきっかけです。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>At first, my main contribution was improving the Japanese documentation. I think that my first relatively big contribution was a <a
href="http://archive.fprog.org/homepage2.nifty.com/zn/jewel/ruby-diff.html">migration note from 1.4 to 1.6</a>. Also, I helped write a reference manual in RWiki. This is because I&#8217;m now involved in <a
href="http://jp.rubyist.net/magazine/">Rubyist Magazine</a> and the Ruby Reference manual project. For the Ruby core, my contribution is mainly small fixes. Recently, I checked a commit and fixed obvious errors such as typos.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>最初は日本語ドキュメント系の貢献が主でした。 たぶん 1.4から1.6への変更点をまとめたもの がそれなりに大きいものの最初で、ドキュメント系では RWiki でのリファレンス マニュアルの手伝いをしていたり、今のるびまやるりまへの関わりに繋がっています。</p><p>Ruby 本体に対しても、昔から細かい修正などの貢献が多かったと思います。 最近はコミットをみて typo などの明らかな間違いを修正していることが多いです。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>I have used Debian and Ubuntu as a server for long time. I&#8217;ll make a presentation at <a
href="http://gum.debian.or.jp/2013/">http://gum.debian.or.jp/2013/</a>.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px">Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>主にサーバーで Debian や Ubuntu をずっと使っていて、今年の http://gum.debian.or.jp/2013/ でも話をする予定です。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/kouhei-sutou.jpeg" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Kouhei<br
/> Sutou</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I&#8217;m Kohei Sutou. My account handle is kou. I&#8217;m an author of lib/rss. I became a committer as lib/rss was bundled with the Ruby package at [ruby-dev:22720], [ruby-dev:22726], and [ruby-dev:22732]. My first commit is r5572 at 2004-01-29 00:19:56 +0900. (The revision was changed because we used CVS at that time.) When I was in college, an older student told me about Ruby, which caused me to be involved with Ruby.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px">Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>須藤功平（Kouhei Sutou）です。アカウント名はkouです。 lib/rss/の作者です。[ruby-dev:22720]、[ruby-dev:22726]、 [ruby-dev:22732]でlib/rss/が標準添付になったのでコミッタにな りました。2004-01-29 00:19:56 +0900のr5572（当時はCVSなのでリビ ジョンは違う）が最初のコミットです。 Rubyと関わるようになったきっかけは大学の先輩からRubyというも のがあると教えてもらったからです。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I&#8217;m a maintainer of lib/rss/ and lib/rexml/. Both are now in maintenance mode; I just play the role only when a bug is reported. Before Ruby 2.0.0 was released, I implemented some RubyGems features for supporting default gems. With regard to this work, I added some bugs to 2.0.0. (Sorry!) I did this work just because drbrain incidentally sat opposite to me at the party of Sapporo RubyKaigi 2012.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px">Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>lib/rss/とlib/rexml/のメンテナーです。 今はどちらもメンテナンスモードなのでバグレポートがあると対応 しているぐらいです。</p><p>Ruby 2.0.0リリースの前にRubyGemsにdefault gem関連の機能を実 装しました。また、default gemに関連したバグをいくつかRuby 2.0.0に入れました。（すみません。） default gemをやる気になったのは札幌Ruby会議2012の懇親会でた またま目の前にdrbrainが座っていたからです。</p></div><div
style="float: left;width: 270px;margin: 10px;text-align:right;padding-top: 142px"> <i>The appearance of my bonsai<br
/>as of May 4th 2013.</i></div><div
style="float: left;width: 260px;margin: 10px"> <img
alt="" src="http://cdn.rubysource.com/files/2013/06/bonzai.jpg" /></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>Growing a humble bonsai (Japanese black pine) with moderate passion not to blight it.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px">Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>立派じゃない盆栽（クロマツ）をクロマツが枯れない程度の情熱で育て ることです。</p></div><p></p><div
style="clear: left"></div><h2>Tomoyuki Chikanaga</h2><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>When I was a university student, my mentor introduced Ruby to me. I wrote prototypes of neural network software in Ruby and felt it was an easy to use and powerful language. I&#8217;ve been writing a blog &#8220;ruby-trunk-changes&#8221; which briefly explains every commit to CRuby trunk repository for about 3 years. I&#8217;d sent some trivial patches. One day Kosaki-san told me &#8220;Hey I&#8217;m tired of dealing with your patches. Commit it by yourself!&#8221;. Since then I have had a commit bit.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>最初にRubyに触れたのは、学生時代に指導してくれた先輩に教えてもらって、 ニューラルネットワークを使ったソフトウェアのプロトタイピングのために使ってみました。 書きやすくて機能も豊富なのですぐ気に入りました。 3年ほど前から ruby-trunk-chages という CRuby の trunk のコミットの短い解説を書く ブログを続けていて、そこで気がついたちょっとした修正のパッチを投げているうちに 小崎さんに「いちいち取り込むの面倒だから自分でコミットして」と言われてコミット権を いただくことになりました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I am an unofficial commit reviewer. I&#8217;ve read all of the commits in trunk, and sometimes point out some problems. And as the 2.0.0 branch maintainer, I decide which commits to backport into the ruby20_0 branch.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>コミットの(非公式な)レビューアとして、trunk のコミットを読み続けています。たまに間違いを指摘したりします。 また 2.0.0 のブランチメンテナとして、trunk から ruby20_0 ブランチにバックポートする 変更を選定するなどの仕事をしています。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>Sound programming, Machine Learning, etc&#8230;</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>Ruby 以外に興味のあることを教えてください。 音響系のプログラミングや機械学習などが好きです(が最近ぜんぜんできてない)。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/06/kenta-murata.jpg" /><br
/><small><i>Photo taken by Kakutani-san</i></small></td><td
style="vertical-align: bottom;padding-bottom: 21px"><h2 style="margin: 0 0 0 5px">Kenta<br
/> Murata</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I work for COOKPAD Inc. as a dev-infra engineer.  I live in Tokyo, but my original home town is Tomakomai, Hokkaido.  Since my wife lives in Sapporo, I frequently go back to Hokkaido almost every month.</p><p> About ten years ago, I was a member of Kondara Project, which developed the one of famous Linux distributions in Japan, Kondara MNU/Linux.  This project primarily used Ruby for developing some system utilities and almost all distribution development utilities. I started to use Ruby to join development of these Kondara-specific utilities.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>クックパッド株式会社で開発基盤エンジニアとして働いています。 今は東京に住んでますが、元々は北海道苫小牧市の出身です。 現在、妻が札幌に住んでいるため、毎月北海道に帰っています。</p><p> 約10年前、私は、Kondara MNU/Linux という日本で有名だった Linux ディストリビューションを開発する Kondara Project のメンバーでした。 Kondara Project では、様々なツールを Ruby で開発していました。 私は、それらのツールの開発に参加するために Ruby を使い始めました。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>I&#8217;ve done and continued these things, but I think I should spare more time to contribute much more&#8230;<br
/> &#8211; A maintainer of bigdecimal<br
/> &#8211; OS X platform maintainer<br
/> &#8211; The provider of rubyci for OS X<br
/> &#8211; The one of contributors for mathematical part<br
/> &#8211; The bug fix for OS X (occasionally)</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>私がやってきたことは以下のとおりです。もっと Ruby に貢献できる時間を増やしたいなと思ってます。<br
/> &#8211; bigdecimal のメンテナンスと開発<br
/> &#8211; OS X プラットフォームのメンテナ<br
/> &#8211; rubyci の OS X 版を提供<br
/> &#8211; 数学関係のコントリビューション<br
/> &#8211; OS X 関連のバグ修正 (稀)</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>My main hobby is studying mathematics and theoretical physics. I love them because they are very fun.</p><p> Cooking is another hobby for me after joining COOKPAD. I sometimes cook in the office because the kitchen is very wide and there are enough kinds of ingredients; COOKPAD supplies a lot of ingredients for its employees to cook in their office hours.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>主な趣味は、数学と理論物理学の勉強です。</p><p> クックパッドに入社してから、料理も楽しく感じるようになりました。 会社に広いキッチンと様々な種類の材料があるので、会社で時々料理をしています。 クックパッドは、社員が勤務時間中に料理できるように、多くの材料を買い揃えてくれています。</p></div><p></p><div
style="clear: left"></div><h2>Masaya Tarui</h2><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>My name is Masaya Tarui. I like to study various algorithms. Around 2000, I migrated from Perl4 to Ruby, as a prototyping tool for algorithms.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>樽家昌也（@taru）といいます。 趣味で色々なアルゴリズムを勉強してます。 アルゴリズムをプロトタイピングするツールとして、perl4の時にrubyに移りました。(時期としておおよそ2000年)</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>Currently I have no particular responsibility. I fix or modify anything that bothers and/or interests me. After 2.0.0 was released, I&#8217;m a bit inactive. I worked harder to make the Windows port stable when 1.9.2 was released. But many users look more pleased at the performance improvement of 1.9&#8242;s require.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>特にどこかの箇所に責任を持っている状態ではなく、自分自身が困った所、 興味を持った所を修正または変更する立場をとっています。 2.0.0がリリースされてからは開店休業状態です。 成果としては、1.9.2リリース時のwindows環境の安定化 が一番頑張った所ですが、 世間では1.9のrequireを速くした事が喜ばれているようです。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>I like to live lazily :-) Recently, I&#8217;m interested in how to handle a huge amount of distributed data (i.e., put in a lot of devices and web platforms), in an efficient and secure way.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>いかに怠惰に生きるか:-) 直近では、大量のデータをいろんなデバイスやweb上のプラットフォームで分散して持つようになって、 どうやってセキュリティを確保しつつ効率的にハンドリングするかをぼんやりと考えてます。</p></div><p></p><div
style="clear: left"></div><table
border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="vertical-align: top"><img
alt="" src="http://cdn.rubysource.com/files/2013/05/shibata-hiroshi.png" /></td><td
style="vertical-align: bottom"><h2 style="margin: 0 0 0 5px">Hiroshi<br
/> Shibata</h2></td></tr></tbody></table><div
style="float: left;width: 270px;margin: 10px"><p>Q: Can you tell us a bit about yourself, and how you became involved with Ruby?</p><p>I&#8217;m Hiroshi Shibata. My account handle of github and twitter is @hsbt. I&#8217;m working as an engineer in Paperboy &amp; Co., a web service company. I encountered Ruby in a math course during my student days.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: 自己紹介と、Ruby と関わるようになったきっかけを教えてください。</p><p>SHIBATA Hiroshi, github, twitter アカウントは @hsbt です。paperboy&amp;co. という Webサービスの会社でエンジニアをやっています。 Ruby に関わるようになったきっかけは学生時代の数学の授業で紹介された時です。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What role did you play on the Ruby 2.0 project?</p><p>In 2.0 release management, I was a QA (Quality Assurance) tester by running some actual applications on trunk and checking if they work correctly. For the 2.1 release, I will play three roles: QA, maintaining the web site of ruby-lang.org, and supporting and improving the development environment for Ruby committers.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby プロジェクトにおけるあなたの役割はなんですか？</p><p>2.0 のリリースでは実際に使われているアプリケーションを trunk で動かして 満足に動作するかをチェックするQAを担当しました。 2.1 のリリースに向けては * QA * ruby-lang.org に存在するサイトのメンテナンス * Ruby コミッタの開発環境支援 の三つを担当しています。</p></div><div
style="clear: left"></div><div
style="float: left;width: 270px;margin: 10px"><p>Q: What do you like to do outside of Ruby or programming in general?</p><p>My hobby is doing presentations at international conferences and using the opportunity to travel with my wife. In June, I&#8217;ll attend RedDotRubyConf in Singapore.</p></div><div
style="float: left;width: 260px;background-color: #f8f9d3;margin: 10px;padding: 5px"><p>Q: Ruby 以外に興味のあることを教えてください。(プログラミング全般でも、プログラミング関係ない趣味でも)</p><p>趣味は海外のカンファレンスに発表するついでに妻と旅行することです。 6月にはシンガポールの RedDotRubyConf に行きます。</p></div> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/meet-fifteen-ruby-core-committers/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Interviewing Rogues &#8211; James Edward Gray II</title><link>http://rubysource.com/interviewing-rogues-james-edward-gray-ii/</link> <comments>http://rubysource.com/interviewing-rogues-james-edward-gray-ii/#comments</comments> <pubDate>Thu, 13 Jun 2013 13:30:48 +0000</pubDate> <dc:creator>Thom Parkin</dc:creator> <category><![CDATA[Misc]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5883</guid> <description><![CDATA[The Ruby Knowledgebase Every week a group of Ruby Enthusiasts get together in a Virtual Roundtable and explore/discuss/argue some aspect of the Ruby language or the Ruby community. They allow the rest of us to listen in on their discussion by way&#8230;]]></description> <content:encoded><![CDATA[<h2> <a
href="http://rubysource.com/?attachment_id=5901" rel="attachment wp-att-5901"><img
class="alignleft size-medium wp-image-5901" alt="jeg" src="http://cdn.rubysource.com/files/2013/06/jeg1-300x300.png" width="300" height="300" /></a>The Ruby Knowledgebase</h2><p>Every week a group of Ruby Enthusiasts get together in a Virtual Roundtable and explore/discuss/argue some aspect of the Ruby language or the Ruby community. They allow the rest of us to listen in on their discussion by way of The Ruby Rogues podcast. The podcast can be accessed on iTunes or on <a
href="http://www.rubyrogues.com">the website</a> and offers a ‘fly on the wall’ view of a great bunch of technology savvy people sharing their ideas and opinions.</p><p>In this series of articles I will share the results of my interviews with each member of this special group.</p><p><strong>Thom:</strong> The first thing I’d like to ask, James, is tell us a little bit about yourself.</p><p><strong>James:</strong> I’m a programmer. That is my day job. I use primarily Rails to build web applications. I’ve been in the community a long time now. I came in kind of at the end of the first era of Ruby, you might say. The first era where we had a handful of people just playing with the language before Rails even landed. Suddenly Rails got popular and one of my hobby skills turned out to be valuable.</p><p><strong>Thom:</strong> About how long ago was that?</p><p><strong>James:</strong> Ruby, actually as a language, has been around since 1995. But there weren’t a lot of people playing with it outside of Japan back then. <a
href="http://en.wikipedia.org/wiki/Dave_Thomas_(programmer)">Dave Thomas</a> found it. I can’t remember when the original <a
href="http://pragprog.com/book/ruby/programming-ruby">Pickaxe Book</a> was published, but I would suspect it’s in the early 2000s. I came into the community, I think, in the summer of 2004.</p><p><strong>Thom:</strong> Unlike many of us who discovered Ruby through Rails, you actually came the other way around. You discovered Ruby first before Rails existed, is that correct?</p><p><strong>James:</strong> Yes. I was playing with Ruby back when Rails was under development.</p><p><strong>Thom:</strong> So what kind of things did you do with Ruby? Desktop development and scripting?</p><p><strong>James:</strong> I used it largely as a scripting environment. At a big job I worked back then, we used Perl everywhere to do a bunch of data manipulation. It was for a company that had a very large product-base. They would transform the products into reports, static websites, and such. We just used Perl for all of that. Then I got into using Ruby in those similar applications. Eventually, after Rails became popular, I began playing with that and figuring it out. I moved up the ladder that way. So you’re right, I came the other way.</p><p><strong>Thom:</strong> That’s very interesting and I think that’s probably (as I said) not the norm. Many of us discovered Rails which brought us to Ruby.</p><p>The other question that I’ve asked <a
href="http://rubysource.com/interviewing-Rogues-charles-max-wood/">Charles Max Wood</a>, and even though I’ve gotten the story from him, I’d like to get your perspective on it; how did the <a
href="http://rubyrogues.com/">Ruby Rogues</a> begin?</p><p><strong>James:</strong> It’s an interesting story. I listened to another podcast that is a panel discussion on a totally unrelated topic. I just always liked that format, where there are several people talking to each other and hashing out ideas instead of just individual interviews. I can’t remember if it was me or <a
href="http://rubysource.com/interviewing-Rogues-charles-max-wood/">Chuck</a> that originally tweeted, “I’d like to see a panel discussion of Ruby.” But both he and I had been thinking basically the same thing at the same time. So one of us tweeted it and then the other one was like, “I’ve been thinking about that, too.”</p><p>That was what put <a
href="http://rubysource.com/interviewing-Rogues-charles-max-wood/">Chuck</a> and me in touch. We became the first two. We started fleshing it out and then the original members of the podcast were all friends of ours; Aaron Patterson, Peter Cooper, and David Brady were just people we knew and we asked if they would do it. They did and that was how we originally put it together.</p><p>Then, over time, people came and went and we settled on the group that we currently have today.</p><p><strong>Thom:</strong> So you and <a
href="http://rubysource.com/interviewing-Rogues-charles-max-wood/">Chuck</a> were following each other on Twitter, had you met maybe at a conference or something or how did that happen?</p><p><strong>James:</strong> Yes, I believe we had met at that time. I think we did meet at a conference. I had gone down to a <a
href="http://mtnwestrubyconf.org/">MountainWest Ruby Conference</a>, the one in Salt Lake City, Utah. I went there maybe in 2009. I spoke there. I think my wife also gave a small presentation.</p><p><strong>Thom:</strong> Is your wife a techie? Is she a programmer also?</p><p><strong>James:</strong> Yeah, she worked for me for a couple of years doing Rails development, but now we have a small baby and she spends more time chasing her around.</p><p><strong>Thom:</strong> I understand that. But I am envious!</p><p><strong>James:</strong> She still helps with the non-coding side of the business, but the coding side is a bit much with a young one.</p><p>As I said, I think I met <a
href="http://rubysource.com/interviewing-Rogues-charles-max-wood/">Chuck</a> when I was at the <a
href="http://mtnwestrubyconf.org/">MountainWest Ruby Conference</a>. I had met all of the original <a
href="http://rubyrogues.com/">Rogues</a> by that time, with the exception of Peter. Then Josh and <a
href="http://avdi.org">Avdi</a> came on and I had not met either of them.</p><p><strong>Thom:</strong> You mentioned some names that are now, I want to say &#8216;household names&#8217; within the Ruby on Rails community, but I’m guessing at that time maybe they were not. They were just the guys that came to a few conferences and were giving talks?</p><p><strong>James:</strong> It’s a good question. I’m not sure how much <a
href="http://tenderlovemaking.com/">Aaron Patterson</a> was doing with Rails at that time, probably some. But he was already known for things like <a
href="http://nokogiri.org/tutorials/installing_nokogiri.html">Nokogiri</a>. He had built many tools before that time. People knew him that way. Peter Cooper had his <a
href="http://rubyweekly.com/">Ruby Weekly mailing list</a> by then, but not the massive empire that he has today.</p><p><strong>Thom:</strong> Yeah, you can kind of claim, “I knew him when&#8230;”</p><p><strong>James:</strong> Right. That’s what I think led both of them actually to eventually move on as their time commitments are much, much bigger now.</p><p>I think it was Aaron, when he was off one week, who said, “Hey, we ought to have Josh on the show,” and we tried him. Somebody else mentioned <a
href="http://avdi.org">Avdi</a> or I knew of <a
href="http://rubysource.com/interviewing-rogues-avdi-grimm/">Avdi</a> and we had them on a couple of times. It was a great fit and we all loved that. So, as the others moved on, we brought them on full-time and it’s just been a great group ever since.</p><p><strong>Thom:</strong> I think <a
href="https://github.com/cmaxw">Chuck</a> put it well when he told the story about <a
href="https://github.com/kytrinyx">Katrina</a>, that her guest appearance had been so well received and you guys got along so well with her, that it got to the point in the discussion that there simply was not enough room for another person, everybody raised their hand and said, “Well, I’ll give up my spot!”</p><p><strong>James:</strong> Yes, that’s pretty much how it happened.</p><p><a
href="https://github.com/kytrinyx">Katrina</a> is very modest, I’ve actually read <a
href="http://rubysource.com/interviewing-rogues-katrina-owen/">your interview of her</a> where she calls herself a beginner and stuff like that. If you believe that, you’re not a regular listener of <a
href="http://rubyrogues.com">the show</a>.</p><p>She has those rare qualities of being good with code—able to think about code and stuff—and then also being able to explain code. That is one of my favorite things about her. That she can take something and she just describes it in a way that’s very simple. I think that’s really unusual to have in programmers. I think we’re notoriously not great at communicating our ideas.</p><p><strong>Thom:</strong> Boy, you’re absolutely right about that!</p><p>I know as a listener, I am very impressed with her. <a
href="https://github.com/kytrinyx">Katrina</a> doesn’t seem to speak as often, but when she has something to say, it’s usually very insightful.</p><p><strong>James:</strong> Yes, both her and <a
href="http://avdi.org">Avdi</a> are the quiet ones. They don’t jump in there and butt in a lot. I’m the loud one. I’m the one they can never get to shut up, right? They don’t talk as much but whenever they do pipe up and ask a question, it’s very insightful and usually leads to a great discussion.</p><p>You also don’t see how much people do behind the scenes, <a
href="https://github.com/kytrinyx">Katrina</a> especially. She used to be a transcriptionist and so, as we’re sitting there talking, we tend to use a lot of horrible things like acronyms or strange words like &#8220;The Threequel Operator” or something that would drive a transcriptionist mad. <a
href="https://github.com/kytrinyx">Katrina</a> is sitting there in the back channel typing all those out as we say them, typically.</p><p>She supports us a lot in that way and recently she’s been booking shows and stuff, too. She set up <a
href="http://rubyrogues.com/105-rr-regular-expressions-with-nell-shamrell/">the show on Regular Expressions</a>, with <a
href="http://www.nellshamrell.com/">Nell Shamrell</a>, which was a really great episode. So she helps out a lot even when she’s not asking questions. But I tend to enjoy the ones where I take a week off. Without me butting in all the time, I think the others get to talk more and I always enjoy those episodes.</p><p><strong>Thom:</strong> So the <a
href="http://rubyrogues.com/">Ruby Rogues</a> has crossed <strong>100 Episodes</strong>, which is a pretty big deal.</p><p><strong>James:</strong> Yeah, we were surprised.</p><p><strong>Thom:</strong> Does it feel like it’s been 100 or maybe, in some ways, it feels like it’s been more?</p><p><strong>James:</strong> You know, I think we were all surprised when we hit the 100-episode milestone, that we’d been going so long. Just the other day we realized that our mailing list was one year old, and that’s shocking.</p><p><strong>Thom:</strong> Oh, what a great confluence.</p><p><strong>James:</strong> I think we’re all surprised by it. I’m sure that there’ll come a point when burn-out sets in or we feel like we’ve talked about all the things we want to talk about. But I can tell you from our current list that we have a lot of things we would like to talk about and we haven’t gotten to. I mean, like you said, we’re 100 episodes in and Regular Expressions is one of my favorite things in all of Ruby and we just did the episode on that.</p><p><strong>Thom:</strong> That’s exciting.</p><p><strong>James:</strong> I was excited about doing that one, too, although I think it has even more of the problem, as usual, of me talking too much because it’s my favorite subject.</p><p><strong>Thom:</strong> You’ve been a pretty regular contributor to Rails, and since you mentioned you’ve been involved in Ruby even before Rails, how does that feel to have such a strong influence on something that has become quite an important and well-recognized framework?</p><p><strong>James:</strong> Actually, I’ve only contributed to Rails a couple of times in minor ways. I have done a lot as far as the teaching Rails and stuff, but as far as the source code itself, I’ve only had a few small commits.<br
/> <a
href="http://blog.hasmanythrough.com/">Josh</a>, actually has done quite a bit more than I have as far as contributions.</p><p><strong>Thom:</strong> Okay, I misunderstood that then, but you’ve written a lot of Gems.</p><p><strong>James:</strong> I have written a lot of Gems, I don’t know how many of them actually end up being useful…</p><p><strong>Thom:</strong> We all feel that way.</p><p><strong>James:</strong> Right, right. The <a
href="http://fastercsv.rubyforge.org/">FasterCSV Gem</a> is probably the one I’ve had that’s been the most successful, that eventually became the <a
href="http://www.ruby-doc.org/stdlib-2.0/libdoc/csv/rdoc/index.html">CSV Standard Library in Ruby 1.9</a> and on.</p><p><strong>Thom:</strong> That’s something to be proud of, certainly.</p><p><strong>James:</strong> Yes, I was glad to see that. The <a
href="http://highline.rubyforge.org/">HighLine Gem</a> that I wrote with Greg Brown&#8217;s help, it also is still pretty widely used, I believe. Those are probably the two I’ve written that have had the most impact.</p><p><strong>Thom:</strong> You mentioned earlier, and I realize it was kind of in the vein of self-deprecating humor, but you mentioned that you’re the one that’s always talking and butting in. But honestly, what do you see as your role in this panel of an obviously very diverse group of people with different perspectives? Do you see yourself as providing some specific role or guidance there?</p><p><strong>James:</strong> At one time <a
href="https://github.com/joshsusser">Josh</a> put up the various roles of TV Tropes—the <a
href="http://tvtropes.org/">TV Tropes</a> website has a TV Trope called a “<a
href="http://tvtropes.org/pmwiki/pmwiki.php/Main/FiveManBand">Five-Man Band</a>” and for like a week afterward we were all trying to figure out which position is us.</p><p>But seriously, I think one of the things that I bring to the table in the <a
href="http://rubyrogues.com/">Rogues</a> is not so much technique and things like that, I think the others are better at that than me. <a
href="https://github.com/joshsusser">Josh</a> especially has a really strong Rails background and <a
href="http://avdi.org">Avdi</a> being so good with patterns and things like that. <a
href="https://github.com/kytrinyx">Katrina</a>, the great communicator, like I said before. David is funnier than I am and Chuck is the glue that makes the whole thing possible.</p><p>But I have an almost encyclopedic knowledge of the various corners of Ruby and that comes mostly from running <a
href="http://www.amazon.com/Best-Ruby-Quiz-Pragmatic-Programmers/dp/0976694077">The Ruby Quiz</a> for three years. Every week people would email all these programs to me and I had to read through them and understand them enough that I could talk about them in the write-up I did that week. People solving programming problems use every dirty and metaprogramming trick in the book. So, in my time overseeing that contest, I’ve learned so many dark corners of Ruby and the API. I don’t know what percentage of it is actually in my head, but it’s a very high percentage.</p><p><strong>Thom:</strong> That’s wonderful.</p><p><strong>James:</strong> Just because I’ve played with it a lot and had to figure that stuff out. When we did <a
href="http://rubyrogues.com/105-rr-regular-expressions-with-nell-shamrell/">the regex discussion</a>, at one point we got into the horrors of why the replacement strings of <code>sub</code> and <code>gsub</code>. Why do I have to start doubling my backslashes and I end up with four or eight or whatever? I’m like, “Oh, that’s because,” you know, and I start explaining why that is.</p><p>I think that’s maybe the thing I bring to the table. I have the knowledge of Ruby and how it works.</p><p><strong>Thom:</strong> A final question. Is there anything that you’re working on presently that you would like to promote or to tell the world about?</p><p><strong>James:</strong> That’s a good question. I’m one of those people that never hurts for ideas. I wake up every day with more ideas and I keep this file on my computer where I squirrel them all away for some day. I’m always working on 3-500 of them at any given time.</p><p><strong>Thom:</strong> Is that 3 to 500 and not 300 to 500?</p><p><strong>James:</strong> Yeah, it’s something like that. &#8220;Too many&#8221; is how my wife would describe it, I’m sure. I never hurt for ideas, but, some become other things or some I end up using on work projects or some I give up on for various reasons of time or realize it was a bad idea or whatever. I don’t know which ones actually end up being things that get there. I think we all have that problem. There’s several things I’m working on that I hope turn out to be as cool as I think they’ll be, but I don’t think I’m ready to share those yet.</p><p>I will say the one thing, of interest to <a
href="http://rubyrogues.com/">Rogues</a> listeners, that we’re working on. We’ve mentioned it a bunch in the past and there was kind of a long period of us not talking about it for various reasons, mostly just getting it all working, but we are in the process of working on the <a
href="http://rubyrogues.com/">Ruby Rogues</a> first book, which will be &#8220;Ruby Best Practice Patterns&#8221;, a Ruby port [basically] of <a
href="http://www.amazon.com/Smalltalk-Best-Practice-Patterns-ebook/dp/B00BBDLIME/ref=la_B000APC0EY_1_5?ie=UTF8&amp;qid=1369437373&amp;sr=1-5">SmallTalk Best Practice Patterns</a> from <a
href="http://en.wikipedia.org/wiki/Kent_Beck">Kent Beck</a>.</p><p><strong>Thom:</strong> Oh, that’s an excellent idea for a book.</p><p><strong>James:</strong> I want to say that as one of the <a
href="http://rubyrogues.com/">Ruby Rogues</a>, I feel very lucky to spend time every week with the likes of Josh Susser, <a
href="http://rubysource.com/interviewing-rogues-avdi-grimm/">Avdi Grimm</a>, <a
href="http://rubysource.com/interviewing-rogues-david-brady/">David Brady</a>, <a
href="http://rubysource.com/interviewing-rogues-charles-max-wood/">Charles Max Wood</a> and <a
href="http://rubysource.com/interviewing-rogues-katrina-owen/">Katrina Owen</a>.</p><p><strong>Thom:</strong> Thank you, James, for your time and the insight you provided us.</p><p>James Edward Gray II can be found, in addition to the weekly broadcast of the <a
href="http://rubyrogues.com/">Ruby Rogues</a>,</p><ul><li><a
href="https://twitter.com/JEG2">Twitter</a></li><li><a
href="https://github.com/JEG2">Github</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/interviewing-rogues-james-edward-gray-ii/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <series:name><![CDATA[Interviewing Rogues]]></series:name> </item> <item><title>8 Simple Steps for Contributing to Open Source</title><link>http://rubysource.com/8-simple-steps-for-contributing-to-open-source/</link> <comments>http://rubysource.com/8-simple-steps-for-contributing-to-open-source/#comments</comments> <pubDate>Mon, 10 Jun 2013 13:30:41 +0000</pubDate> <dc:creator>Glenn Goodrich</dc:creator> <category><![CDATA[Getting Started]]></category> <category><![CDATA[JRuby]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5886</guid> <description><![CDATA[The Ruby community embraces open source like no other community. These days, any Ruby developer worth their salt is expected to have authored or contributed to an open source library. Git and Github have made sharing code easy and contributing simple. However,&#8230;]]></description> <content:encoded><![CDATA[<p><a
href="http://rubysource.com/?attachment_id=5888" rel="attachment wp-att-5888"><img
class="alignleft size-full wp-image-5888" alt="fork" src="http://cdn.rubysource.com/files/2013/06/fork.png" width="80" height="50" /></a>The Ruby community embraces open source like no other community. These days, any Ruby developer worth their salt is expected to have authored or contributed to an open source library. Git and <a
href="http://github.com">Github</a> have made sharing code easy and contributing simple.</p><p>However, making your first contribution to an open source library can be very daunting. If you&#8217;re like me, I was/am nagged by self-doubt and a fear that I would/will &#8220;do it wrong.&#8221; I worry about the mocking of other developers, all solidified by years of open source contributions. They will shred my code and use my avatar as a meme to terrible coding.</p><p>I did, eventually, get past this fear. I have contributed to a few open source projects (<a
title="AngularJS" href="http://angularjs.org">AngularJS</a>, <a
title="Neography" href="https://github.com/maxdemarzi/neography">neography</a>, <a
title="JQuery UI" href="http://jqueryui.com">jquery-ui</a>, just to name a few) and I can tell you it&#8217;s not so bad. If you are stuck in the self-doubt phase, but want to jump in, you may be asking &#8220;What&#8217;s the first step?&#8221; or &#8220;How do I contribute?&#8221; Well, I aim to answer those kinds of questions by walking you through my attempt at contributing to the wonderful <a
href="http://github.com/jkutner/guard-jruby-rspec">guard-jruby-rspec</a> gem.</p><p>The Steps are:<br
/> 1. Search<br
/> 2. Fork<br
/> 3. Prepare Your Local Environment<br
/> 4. Write a Test<br
/> 5. Fix It<br
/> 6. Commit and Push It<br
/> 7. Test It<br
/> 8. Issue the Pull Request</p><h2>The Gem</h2><p>I am currently working on a JRuby project that uses RSpec. Running the tests continuously, automatically, and (most importantly) quickly is paramount. I pulled in the guard-jruby-rspec gem to do just that, and it runs my tests faster than any other solution I&#8217;ve seen on any Ruby project. <a
href="https://github.com/jkutner"> Joe Kutner </a>, author of <a
href="http://pragprog.com/book/jkdepj/deploying-with-jruby">Deploying with JRuby</a> has done a brilliant job with the gem. (Joe also reviewed this article, so thanks for that too!)</p><p>Briefly, let me explain what guard-jruby-rspec does. The gem is a plugin to Guard which, according to its Github page, is &#8220;a command line tool to easily handle events on file system modifications.&#8221; It is most often used to monitor files in a Ruby or Rails project and fire off the affected tests as files change. If a controller file is changed, the corresponding test file is automatically run. This is invaluable, as you get constant feedback as you code. Automate all the things.</p><p>Guard has a thriving plugin framework, and guard-jruby-rspec is one of the many plugins. guard-jruby-rspec, as you may have guessed, runs RSpec on files based on &#8220;watchers&#8221; in you Guardfile. It leverages JRuby to minimize the loading time for each test.</p><p>In a Rails app, for example, if the Guardfile looks like:</p><pre class="brush: ruby; title: ; notranslate">
interactor :simple
guard 'jruby-rspec' do
  watch(%r{^spec/.+\_spec.rb$})
  watch(%r{^lib/(.+)\.rb$})     { |m| &quot;spec/lib/#{m[1]}_spec.rb&quot; }
  watch('spec/spec_helper.rb')  { &quot;spec&quot; }
  # Rails example
  watch(%r{^app/(.+)\.rb$})                           { |m| &quot;spec/#{m[1]}_spec.rb&quot; }
  watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| &quot;spec/#{m[1]}#{m[2]}_spec.rb&quot; }
  # HEY THIS LINE IS IMPORTANT
  watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| [&quot;spec/routing/#{m[1]}_routing_spec.rb&quot;, &quot;spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb&quot;, &quot;spec/acceptance/#{m[1]}_spec.rb&quot;] }
  watch(%r{^spec/support/(.+)\.rb$})                  { &quot;spec&quot; }
  watch('app/controllers/application_controller.rb')  { &quot;spec/controllers&quot; }
  # Capybara features specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| &quot;spec/features/#{m[1]}_spec.rb&quot; }
end
</pre><p>Anytime a file changes that matchers a watcher, the specs run. If you pass in a block to the watcher, you can narrow down the specs that will run. In other words, when I change a model file it will run just the model spec.</p><h2>The Problem</h2><p>As I was working, I noticed that Guard would fail anytime I changed and saved a controller file. Here is the error:</p><pre class="brush: bash; title: ; notranslate">
16:29:43 - ERROR - Guard::JRubyRSpec failed to achieve its &amp;lt;run_on_changes&amp;gt;, exception was:
[# NoMethodError: undefined method `match' for #&amp;lt;Array:0x4816505b&amp;gt;
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec/inspector.rb:50:in `spec_folder?'
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec/inspector.rb:38:in `should_run_spec_file?'
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec/inspector.rb:30:in `clean'
[#] org/jruby/RubyArray.java:2395:in `select'
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec/inspector.rb:30:in `clean'
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec/inspector.rb:62:in `clear_spec_files_list_after'
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec/inspector.rb:29:in `clean'
[#] /home/vagrant/ws/rental_express/ROOT/rails/.bundle/jruby/1.8/gems/guard-rspec-2.5.4/lib/guard/rspec.rb:85:in `run_on_changes'
[#] /vagrant/git/guard-jruby-rspec/lib/guard/jruby-rspec.rb:74:in `run_on_changes'
[#] org/jruby/RubyKernel.java:2080:in `send'
...
</pre><p>I started looking around to see if I could figure out how to fix this error, and this is how I did it.</p><h2>Step 1: Search</h2><p>In many cases, you are not the first one to find an issue. Especially if the issue is with a well-used gem or framework, like Rails. Before you start frolicking through the code, it&#8217;s smart to ask Google to see if someone else has the issue.</p><p>Also, you should find the code base on Github (the vast majority of open source gems/code can be found on Github) and search its issues for your problem. Chances are someone else is also having the issue and/or working on a fix.</p><p>What do you search for? I find that using the meat of the error message (if you have one) has a high incidence of success. Take out the line numbers and your local computer/directory names and search for the error. In this example, I searched for the following:</p><ul><li>NoMethodError: undefined method `match&#8217; for Array</li><li>JRuby Guard NoMethodError: undefined method `match&#8217; for Array</li></ul><p>No dice.</p><p>If you don&#8217;t have an error or your error isn&#8217;t helping, try searching for the major gems involved. In this case, I might search for &#8220;Guard JRuby Rspec Rails Array match&#8221; and see what pops up. Most times, you&#8217;ll get a few <a
href="http://stackoverflow.com"> StackOverflow </a> hits and you&#8217;ll be on the road to recovery. This, however, was not the case for me. Sad panda.</p><p>I found the <a
href="http://github.com/jkutner/guard-jruby-rspec">code on Github</a> and searched the repository for &#8220;undefined method match for Array&#8221; and BINGO! Sure enough, someone else had the same <a
href="https://github.com/jkutner/guard-jruby-rspec/issues/34">issue</a>. It was only a day old, as well, so there was still blood in the water.</p><p>I added a &#8220;I am getting this too&#8221; comment and let them know what version of the gem I am using. In this case, I also added &#8220;I plan to investigate further&#8221; to let them know that I was taking a crack at fixing it. On to Step 2&#8230;</p><h2>Step 2: Fork</h2><p>Since the code for the gem I am investigating is on Github, I can easily make my own copy of it. This is called &#8220;forking&#8221; and is a step in the process made possible by the fantastic-ness of Github. Some people think forking is a git thing, but it is not. All forking does is copy/clone the repository to a location under your user on Github. In my case, I now have <a
href="http://github.com/ruprict/guard-jruby-rspec">ruprict/guard-jruby-rspec</a> repository that I can hack on to my heart&#8217;s content.</p><p>Once I have a fork, I like to add it to my Gemfile and make sure the issue is still happening. In order to add a gem to your Gemfile that is sourced from a github repository, you do this:</p><pre class="brush: ruby; title: ; notranslate">
gem 'guard-jruby-rspec', github: 'ruprict/guard-jruby-rspec'
</pre><p>After a quick <code>bundle</code>, I run <code>guard</code> and make sure the issue is still there. It is.</p><p>Now, I need to get this code locally on my laptop so I can start working on it. This is a simple <code>git clone git@github.com:ruprict/guard-jruby-rspec.git</code> from my local terminal, and we&#8217;re cooking with gas. Step 3, you&#8217;re up.</p><h2>Step 3: Prepare Your Local Environment</h2><p>OK, I&#8217;ve cloned the repo and switched into my local directory. I like to wall off my work when I am working on something like this, so I use <a
href="http://rvm.io"> RVM </a> because it is fabulous.</p><p>Since this is a JRuby gem, I need to make sure I have JRuby installed (I am using 1.7.4, so <code>rvm install jruby</code>) and then create a gemset. I named my gemset &#8220;guard-jruby-rspec&#8221; and added a <code>.ruby-version</code> and <code>.ruby-gemset</code> to the directory so that it switches to the right environment when I am in this directory. You can use <code>.rvmrc</code> file (link) for this too, but everything seems to be going the way of <code>.ruby-version</code>.</p><p>Once you&#8217;re in your new gemset (or other walled-off environment) run <code>bundle install</code> to install all the dependencies of the gem. Most gemspecs will have a Gemfile that points to the dependencies listed in the gemspec file. You&#8217;ll see all your dependencies go by, like so:<br
/> <img
title="Bundler" alt="Bundle install" src="http://i.imgur.com/MZ3eH5z.png" /></p><p>We are now to the most important step in preparing our development environment: Running the tests/specs. This is Ruby, so all gems should have some tests. You should NOT start development until the existing tests run successfully in your environment. Most often it is simply a case of running <code>rake test</code> or <code>rake spec</code> or, in this case, <code>rspec</code>.</p><p><img
title="Tests Passing" alt="Tests passing" src="http://i.imgur.com/4KPQ3eU.png" /></p><p>OK, tests are passing. Excelllent. Now we can hack.</p><p>I like to make a git branch for my work so the &#8220;pristine&#8221; environment is just a <code>git checkout</code> away.</p><pre class="brush: bash; title: ; notranslate">
git checkout -b array_error_in_custom_watcher
git push -u origin array_error_in_custom_watcher
</pre><p>The second command forces my local branch to track a branch on my github repository with the same name. I dig it.</p><p>Many gems/repositories will have a section in their README on how to contribute, so make sure you have read that and are following the requested process. guard-jruby-rspec does not have one that I can find (but Angular has a <a
title="AngularJS Contribution Guide" href="http://docs.angularjs.org/misc/contribute">monster</a>), so I am following the &#8220;most common&#8221; process as I know it.</p><h2>Step 4: Write a Test</h2><p>Test Driven Development tells us that you should write a test to reproduce any bug that you are fixing. Sometimes, this is very easy. Other times, not so much. In this case, it&#8217;s somewhere in the middle. I don&#8217;t know how Guard works, so I am going to have to do some investigating into how Guard is put together in order to figure out how to make a test that reproduces the error.</p><p>It&#8217;s a bit more difficult in this case, since the error actually happens in the guard-rspec code. It&#8217;s unlikely that guard-rspec has the issue, though, as no one seems to complain about this error on that repository.</p><p>What makes this a bit more frustrating is that I think I know what the fix is. In this case, when an array of test targets is passed from a watcher block, we&#8217;re getting a <code>NoMethodError</code> on <code>Array</code>. It has to be more than a coincidence that <code>Array</code> is issuing the error and we are returning an <code>Array</code> in our watcher. Go back and look at the Guardfile to see the line I am talking about.</p><p>Looking at the stacktrace, the last time the test is on the guard-jruby-rspec code is on line 74 in the <code>run_on_changes</code> method, which looks like:</p><pre class="brush: ruby; title: ; notranslate">
def run_on_changes(raw_paths)
  unload_previous_examples
  @reloaders.reload(raw_paths)
  unless @custom_watchers.nil? or @custom_watchers.empty?
    paths = []
    raw_paths.each do |p|
      @custom_watchers.each do |w|
        if (m = w.match(p))
          paths &lt;&lt; (w.action.nil? ? p : w.call_action(m))
        end
      end
    end
    super(paths) # THIS IS LINE 74
  end
end
</pre><p>That <code>paths</code> variable is an array of files to run based on the changes passed in to the function in the <code>raw_paths</code> argument. By putting in various <code>puts</code> statements, I know that <code>paths</code> is an array of arrays when it fails. The question is, how do I write a test that reproduces the issue?</p><p>First, I look at the existing tests. I want to try and use the same style and I certainly want to leverage the same tricks (mocking, etc) so I look through the test files to find a spot where I think the test fits best. My first few attempts either break &#8220;wrongly&#8221; or pass when they should fail. Some of the existing tests mock two objects <code>runner</code> and <code>inspector</code>. By tracing the code through the guard-rspec gem (the <code>super</code> call calls the <code>run_on_changes</code> method for <code>Guard::RSpec</code>), I realize that the mocked call to <code>inspector.clean</code> is the key to what I want.</p><p>That call takes an array of paths and, when things are right, it should NOT have an array as an element in the outer array. With that knowledge, I can write an expectation test that ensures the mocked call to inspector has the appropriate arguments.</p><pre class="brush: ruby; title: ; notranslate">
# guard-jruby-rspec/spec/guard/jruby-guard_spec.rb:226
it &quot;works with watchers that have an array of test targets&quot; do
  subject = described_class.new([Guard::Watcher.new(%r{^spec/(.+)$}, lambda { |m| [&quot;spec/#{m[1]}_match&quot;, &quot;spec/#{m[1]}_another.rb&quot;]})])
  test_targets = [&quot;spec/quack_spec_match&quot;, &quot;spec/quack_spec_another.rb&quot;]
  inspector.should_receive(:clean).with(test_targets).and_return(test_targets) # THIS IS THE TEST
  runner.should_receive(:run).with(test_targets) { true }
  subject.run_on_change(['spec/quack_spec'])
end
</pre><p>The test creates a watcher that returns an array of test locations. The <code>test_targets</code> variable is what the inspector SHOULD recieve when things are working. When I run this test, I get a failure on the expectation, because the call to <code>inspector.clean</code> gets an array with an array as the first element.</p><p>If this seems daunting, it isn&#8217;t. The actual process took me around an hour, and I had a lot of failures, wild goose chasing, etc. Each time I failed, I learned a little bit more about the code until I figured out how I needed to structure my test. There are tools that make the investigation of an issue much easier.</p><p>For example, I recently discovered <a
href="https://github.com/tpope/vim-bundler">vim-bundler</a> by Tim &#8220;I should be given a medal&#8221; Pope. This glorious plugin allows me to open gems in my bundle with a simple <code>Btabedit &lt;gem name&gt;</code>, where I can edit the gem in place and never leave my editor. I screamed like a rabid, Beatles fan when I found vim-bundler. Really. Much of my investigation was placing <code>puts</code> statements, etc. into other gems (like <code>Guard::RSpec</code>), which allowed me to see what was happening as I messed about in the code.</p><p>Ahhh, with a test showing the issue. Step 5 will be a breeze.</p><h2>Step 5: Fix It</h2><p>As I mentioned, writing a test to catch the issue is almost always harder than fixing the code. That is true here, as the fix is simply adding <code>.flatten</code> to the <code>paths</code> array we are passing up our inheritance chain.</p><pre class="brush: ruby; title: ; notranslate">
def run_on_changes(raw_paths)
  unload_previous_examples
  @reloaders.reload(raw_paths)
  unless @custom_watchers.nil? or @custom_watchers.empty?
    paths = []
    raw_paths.each do |p|
      @custom_watchers.each do |w|
        if (m = w.match(p))
          paths &lt;&lt; (w.action.nil? ? p : w.call_action(m))
        end
      end
    end
    super(paths.flatten) # Here be the change, mon.
  end
end
 </pre><p>The tests run again and they pass. I sit back and soak in the good feeling.</p><p>It&#8217;s worth noting that this may or may not be the best solution. In this case, it&#8217;s not much code and I have a test. I am happy enough with the code to move on to Step 6.</p><h2>Step 6: Commit and Push It (Get Up on This!)</h2><p>I can now commit the code. A word of caution here: Make sure that your changes only include what the fix NEEDS. In one of my earliest contributions, I had a bunch of whitespace changes left over from adding <code>puts</code> statements or other debug statements. This made my commit touch more files than necessary, and that is not cool.</p><p>In this case, here is my <code>git diff</code>:</p><p><img
title="Git Diff" alt="Git Diff" src="http://i.imgur.com/DDAqRHc.png" /></p><p>As you can see, my changes are just the test and the change. Nice and clean.</p><p>Also, make sure you don&#8217;t commit any new files accidentally. If you&#8217;re in the habit of doing a <code>git add .</code>, then you are in danger of committing temporary editor files or anything else that may have snuck into your path while you were working.</p><p>Finally, make your commit message informative. A good (if not maybe a little overdone) example is the <a
href="https://docs.google.com/a/goodrichs.net/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit?pli=1#">AngularJS commit message conventions</a>. That example is probably at the far end of the SuperDuper Commit Message Spectrum, but it&#8217;s unlikely that anyone will complain if you put too much info into the commit message.</p><p>Here is my commit message:</p><p><img
title="Commit Message" alt="Commit message" src="http://i.imgur.com/HliXmzF.png" /></p><h2>Step 7: Test It</h2><p>I like to go back to the my project where I originally found the bug and add my github repository into the Gemfile, bundle, then make sure the issue is no more. In this case, I add<br
/> <code>gem "guard-jruby-rspec, github: "ruprict/guard-jruby-rspec, branch: "array_error_in_custom_watcher"</code><br
/> to the Gemfile and run <code>bundle update guard-jruby-rspec</code>.</p><p>Now, recreate or go back to the environment that exercises the bug. For me, I simple added the custom watcher that returns an array of test targets back to the Guardfile in my project, started guard (<code>guard</code>), and changed a controller file. I put in an obvious failure, then removed it.</p><p><img
title="No more watcher error" alt="Controller test" src="http://i.imgur.com/T483yVx.png" /></p><p>Since Guard didn&#8217;t blow up all over the place, I am good. The error, she is vanquished!</p><h2>Step 8: Issue the Pull Request</h2><p>The moment has finally arrived. You are about to embark on a journey of open source contributions that will take you to faraway lands and introduce you to alien folk. Or something.<br
/> Go to the branch on your GH repo and click the <em>Pull Request</em> button.</p><p>In your message, mention any issues that you may have read that are fixed or affected by the PR. In my case, I mentioned the issue I found that had the same error. You can mention an issue simply by linking to it in your comment. If your commit message is OK, you shouldn&#8217;t have to type much more than the issue reference.<br
/> Your self-doubt may rise to the surface here, but just go for it. I have yet to meet a OSS author that isn&#8217;t appreciative of someone trying to help. Even if you mess it up, learn, fix, and resubmit it. It&#8217;s the only way you&#8217;ll become an OSS contributing machine.</p><p><img
title="Pull Request" alt="Pull Request" src="http://i.imgur.com/1hPZIdc.png" /></p><p>Congratulations! An optional Step 9 is to have a celebratory adult beverage!</p><h2>Wrap Up</h2><p>I hope this post helps someone get over their fear and apprehesion of contributing to open source. Trust me, if I can do it, ANYONE can do it.  If you are having a hard time finding a bug to work on, I would suggest signing up for <a
title="Code Triage" href="http://www.codetriage.com/" target="_blank">Code Triage</a> which exists to facilitate finding places to help in popular open source libraries.</p><p>Good luck!</p> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/8-simple-steps-for-contributing-to-open-source/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Network Architecture Based on Gaming</title><link>http://rubysource.com/improving-perceived-performance-based-on-gaming/</link> <comments>http://rubysource.com/improving-perceived-performance-based-on-gaming/#comments</comments> <pubDate>Thu, 06 Jun 2013 13:30:21 +0000</pubDate> <dc:creator>João M. D. Moura</dc:creator> <category><![CDATA[Best Practices]]></category> <category><![CDATA[Getting Started]]></category> <category><![CDATA[gamification]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5872</guid> <description><![CDATA[What exactly is network architecture and what does it represent in web app development? Why discuss Network Architecture these days? Those might be some of your questions after reading the title of this article, and this just supports the point that I&#8217;ll&#8230;]]></description> <content:encoded><![CDATA[<p><span
style="font-size: 13px"><a
href="http://rubysource.com/improving-perceived-performance-based-on-gaming/950850_27101514/" rel="attachment wp-att-5875"><img
class="alignleft size-medium wp-image-5875" alt="950850_27101514" src="http://cdn.rubysource.com/files/2013/06/950850_27101514-200x300.jpg" width="200" height="300" /></a>What exactly is network architecture and what does it represent in web app development? Why discuss Network Architecture these days?</span></p><p>Those might be some of your questions after reading the title of this article, and this just supports the point that I&#8217;ll explain in this post.</p><h2>Network Architecture</h2><h3>What is It?</h3><p>There are a lot of different interpretations, but one that fits the bill is one I found on <a
href="http://en.wikipedia.org/wiki/Network_architecture">Wikipedia</a>:</p><blockquote><p>Network architecture is the <strong>design</strong> of a communications network. It is a framework for the specification of a network&#8217;s physical components and their <strong>functional organization and configuration</strong>, its <strong>operational principles and procedures</strong>, as well as data formats used in its operation.</p></blockquote><p>There is a lot of information in this little sentence, but one detail that surprised me was the word <strong>design</strong>. It reminds me of planning, beauty, and functionality. It&#8217;s not just about socket connections, it&#8217;s also about dealing with those connections in smart ways.</p><h3>Why Talk About It?</h3><p>I will try to illustrate this by using a common example. Here&#8217;s a question for you: Which line is longer?</p><p><img
title="Lines Question" alt="Lines question" src="http://i.imgur.com/0HKhXP9.png" /></p><p>We all know that, despite any observations to the contrary, the right answer is that both have the same length. However, this time I have changed the rules and, actually, there is a longer line. We are so used to giving the same answer that we just ignore our instincts, and this is exactly what is happening in the world of Network Architecture these days.</p><p>It&#8217;s simple: Something has changed in the way the world works. Somebody changed the way we relate with devices and apps in the past 5 years. However, nobody mentioned how we &#8211; as developers &#8211; should adapt ourselves to the new paradigms, so we just keep &#8220;giving the same answer&#8221;.</p><h3>What Has Changed?</h3><p>Has the network changed? No. It&#8217;s faster, but it hasn&#8217;t changed really. We may have to deal with it in different ways if we want to build better and faster applications. I believe that this can and will produce a huge change in the technology market in the next few years.</p><p>If it isn&#8217;t the network, what has possibly changed so fast that we are not able to keep up? The societal values.</p><p>Society, more often than not, is changing its values. If there is something that is becoming really precious, it is <strong>time</strong>. Time has become the most important resource to everyone and <strong>now time is actually money and nobody wants to waste it anymore.</strong></p><p>Developers should be able to respond to the new demands of all users around the world. We should be focusing on building real time applications, or at least applications that don&#8217;t make our users waste their time. <strong>Our mission should be reduce the load time to zero!</strong></p><h4>Bottlenecks</h4><p>Unfortunately, it&#8217;s not so simple. There is always a <strong>bottleneck</strong> and this time it&#8217;s the network. How are we supposed to build faster and real time applications if we don&#8217;t even know how our apps will behave on Edge, 3G, 4G or even a regular wired connection?</p><h2>Where is Gaming on This?</h2><p>If there is a market that has always been concerned about real time and responsive applications, in spite of network constraints, it is the games market. We&#8217;ve been building online games since the days of slow dial-up connections in the 90&#8242;s. How did they do it? By asking themselves a simple question: <strong>If speed is important, why do we keep depending solely on the raw speed of the network?</strong></p><p>The result of this mindset is quite easy to visualize. Below you can see the difference between a regular Web Application flow and a Massive Multiplayer Online Role Playing Game (MMORPG) flow:</p><p><img
title="Web Flow" alt="Web Flow" src="http://i.imgur.com/txmYjR6.jpg" width="560" height="240" /></p><p>In the usual flow, there are actions that result in wait times while the application and server deal with our request and the interface is updated.<br
/> But when we are talking about network multiplayer games, we can&#8217;t have wait times. The action can&#8217;t stop to load the next one as everyone must seem to be sharing the same reality from different points of view. As a result, the flow will be something more like this:</p><p><img
title="Games Flow" alt="MMORPG Flow" src="http://i.imgur.com/nbYxEH1.jpg" width="560" height="280" /></p><p>This flow is only possible because we are not talking about speed at all, we are talking about perceived speed. It&#8217;s about cheating, because the users don&#8217;t care what is really happening in the background.</p><p>There are lots of techniques used in gaming that follow this concept. We could and should apply them to our web development process. We will go through four simple techniques that can change a lot about how you are used to build applications.</p><h2>The Fantastic Four Techniques</h2><h3>Render in Client</h3><p>This technique is quite well-known for those who enjoy cutting edge technologies. There are many javascript frameworks and libraries that claim to be &#8220;the-best-template-solution-ever&#8221; and with all these options on the market there is no excuse to not find something that fits your needs. It will certainly make a huge difference in your application performance and user experience. Everything will be loaded at the beginning and the interface will be able to update itself.</p><p>Even if this technique is quite common, there are still plenty of people that avoid this technique. Most of them argue that those libraries don&#8217;t have support for all the devices and browsers that are on the market, so they don&#8217;t use it. It doesn&#8217;t make any sense.</p><p>For a second, let&#8217;s compare browsers with televisions. Imagine that we have different types of televisions, some high quality with all this awesome technology alongside your grandmother&#8217;s television from 90&#8242;s, each representing a browser, I can&#8217;t tell which <em>coughs</em>:</p><p><img
title="Television comparison" alt="Television comparison" src="http://i.imgur.com/qwq5QmW.jpg" width="560" height="240" /></p><p>There is one single signal that is sent to all of the televisions, regardless of what it supports, and each one will render the best image possible. This is called <strong>graceful degradation</strong>, and the result would be something like this:</p><p><img
title="Television rendered" alt="Television rendered" src="http://i.imgur.com/n8wqRoK.jpg" width="560" height="240" /><br
/> When a developer decide not to use render-in-client technique because of lack of browser support, this would be the expected result:</p><p><img
title="Television wrong" alt="Television wrong" src="http://i.imgur.com/gGoVPkk.jpg" width="560" height="240" /></p><p><strong>Don&#8217;t be afraid to deliver the best quality possible for those that can use it. Graceful degradation is a simple concept that can change things a lot.</strong></p><h3>Store Data in Client</h3><p>Making less requests can make your application faster, but sometimes we don&#8217;t realize how simple it is to just store some data in the client instead of sending it to the server. It will not only save you some infrastructure resources, but also help you avoid useless data in the database.</p><p>Some years ago, it was hard to think about storing data in the client, all we had were cookies and sessions, and it wasn&#8217;t safe and spacious enough to be useful. With HTML5, we have <a
href="http://www.w3schools.com/html/html5_webstorage.asp">LocalStorage</a>, a lot of space, and an amazing API to make everything easier. Why not <strong>start to think twice before making remote requests</strong>?</p><h3>Intelligent Preload</h3><p>The word that better describes intelligent preload is <strong>Prediction</strong>. Usually, when we talk about prediction, developers get scared. They start to think about machine learning and huge formulas, but prediction can be quite easy.<strong>The actions that your users will take next are the ones that you should offer.</strong></p><p>Let me illustrate this by showing an example. This would be the basic flow of an Instagram application:</p><p><img
title="Instagram flow" alt="Instagram flow" src="http://i.imgur.com/ZsT2EVM.jpg" width="560" height="320" /></p><p>People think that their image is uploaded when the &#8220;send&#8221; button is pushed, but actually, your image starts to be uploaded at the transition represented by the red dotted line.</p><p>The application assumes that once you selected the shot and scaled and applied filters on the picture, the most expected next action will be to share it. It isn&#8217;t hard to predict, right? No magic formulas. The application will start to upload your image, and once you push the &#8220;send&#8221; button, it feels faster. <strong>Not because it is fast, but because it seems fast.</strong></p><p>If you start to build intelligent applications using logic and preloading assets by predicting the user actions, it will make a huge difference on user perception.</p><h3>Asynchronicity</h3><p>This is a term that everyone uses, but only a few are concerned about the real proposal behind it.<br
/> <strong>The goal is to detach the view from the server</strong>. The server will only respond when requested by the interface, and the interface will update itself and not make the user wait for the response.</p><p>A basic example would be the Gmail interface on iOS. All you have to do to delete an email is to select it and push &#8220;delete&#8221;. The email will automatically and magically go away, disappearing from the interface. However, it hasn&#8217;t been deleted yet, nor was the request wasn&#8217;t sent over the wire. This will happen in the background.<br
/> The point is that the email is not visible and the user is not staring at a spinner or a progress bar. He can keep using your application, being confident that that email was deleted.</p><h3>But, What If the Server Fails?</h3><p><strong>It isn&#8217;t a problem, machines are expected to fail.</strong><br
/> Just let the user know that it happened and ask him to try again later, <strong>I guarantee you that your user will not get mad of being informed about an inconvenienc</strong>. He will, however, if you make him stare at a load bar for many minutes while your interface is locked waiting for a server response.</p><h2>Let&#8217;s do it!</h2><p>Yeah! Let&#8217;s do it, let&#8217;s build awesome-freaking-zero-load-time-applications, but remember, there isn&#8217;t a silver bullet. These techniques are not a solution to all problems, just a collection of good techniques that are used on games.</p><p>They represent a new range of possibilities to our web app development process, helping us follow the users&#8217; requirements. <strong>Don&#8217;t forget, our mission is reduce the load time to zero!</strong>.</p><p>This article is based on one of my recent talks that I had the opportunity to present at the TakeOff Conference in Lille, France in January. It was pretty funny, if you wanna laugh a little bit, you can watch it on <a
href="http://www.youtube.com/watch?v=UgO0xS8HiOA&amp;list=PLMz7qMiFSV93QQUFSDRFWPBcdGHfkySqN">YouTube</a>.</p> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/improving-perceived-performance-based-on-gaming/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ruby, Python, Java, C and Programmer Happiness</title><link>http://rubysource.com/ruby-python-java-c-and-programmer-happiness/</link> <comments>http://rubysource.com/ruby-python-java-c-and-programmer-happiness/#comments</comments> <pubDate>Mon, 03 Jun 2013 13:30:39 +0000</pubDate> <dc:creator>Pat Shaughnessy</dc:creator> <category><![CDATA[JRuby]]></category> <category><![CDATA[Misc]]></category> <category><![CDATA[Opinion]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5842</guid> <description><![CDATA[&#160; “Ruby is designed to make programmers happy.” &#8211; Yukihiro “Matz” Matsumoto Not everyone might agree, but as a Rubyist I think Matz achieved his design goal. There’s something intangible about Ruby’s syntax that makes it fun, rewarding and easy to use&#8230;]]></description> <content:encoded><![CDATA[<p>&nbsp;</p><blockquote><p><strong>“Ruby is designed to make programmers happy.”</strong> &#8211; Yukihiro “Matz” Matsumoto</p></blockquote><p>Not everyone might agree, but as a Rubyist I think Matz achieved his design goal. There’s something intangible about Ruby’s syntax that makes it fun, rewarding and easy to use &#8211; something that makes me happy. I thought it would be fun to compare Ruby with a few other languages by looking at how different open source developers implemented the same method or function in each language. How do the languages differ? Do they make you equally happy?</p><p>And what better example to look at than inside of Ruby itself! Today I’m going to look at how Ruby’s Hash#fetch method is implemented in Ruby (by Rubinius), Python (by Topaz), Java (by JRuby) and finally in C (by standard Ruby 2.0). Of course, there are many other programming languages out there, even other versions of Ruby, but looking at a small slice of Ruby internals gives us an interesting example and allows us to compare apples with apples.</p><h2>Hash#fetch</h2><p>For those of you not familiar with Ruby, or with the the Hash#fetch method, let’s first review what the Hash#fetch does. Fetch allows you to lookup a value from a hash using a key, just like the [] method does. In addition, fetch also allows you to specify a default value Ruby should return if it can’t find the requested key. Here’s the example from the Ruby documentation:</p><p><a
href="http://rubysource.com/?attachment_id=5847" rel="attachment wp-att-5847"><img
class="size-large wp-image-5847 alignnone" alt="fetch1" src="http://cdn.rubysource.com/files/2013/06/fetch1b.png" width="439" height="312" /></a></p><p>Also, if you provide a block Ruby will call it to get a return value if it can’t find the requested key:</p><p><a
href="http://rubysource.com/?attachment_id=5848" rel="attachment wp-att-5848"><img
class="size-full wp-image-5848 alignnone" alt="fetch2" src="http://cdn.rubysource.com/files/2013/06/fetch2.png" width="514" height="197" /></a></p><h2>Hash#fetch in Rubinius</h2><p>Let’s start our survey by looking at how Rubinius implements Hash#fetch. Since Rubinius uses Ruby to implement its kernel, reading the Rubinius source code is a great way to understand exactly what a given Ruby method does.</p><p>Here’s the Rubinius implementation of Hash#fetch from kernel/common/hash19.rb:</p><p><a
href="http://rubysource.com/?attachment_id=5845" rel="attachment wp-att-5845"><img
class="size-large wp-image-5845 alignnone" alt="rbx" src="http://cdn.rubysource.com/files/2013/06/rbx2.png" width="538" height="354" /></a><br
/> As you can see here, there’s a lot to criticize in Ruby’s syntax. And certainly this isn’t the most elegant example of Ruby code in the world.</p><p>But I like it. It makes me happy. Why? Because it’s simple to understand what this code does. The Ruby language doesn’t get in the way of the meaning of the code, of what the code is trying to achieve.</p><p>Reading Ruby is almost like reading pseudocode &#8211; you know, the sort of code you write on a whiteboard while trying to explain some idea or algorithm. Why do you use pseudocode? Because you don’t have time to fuss with language syntax. You just want to get your point across. For me, writing Ruby is just like writing pseudocode.</p><h2>Hash#fetch in Topaz</h2><p>One of the more exciting events this year in the Ruby community was the news that Alex Gaynor had implemented Ruby using Python and the PyPy toolkit. PyPy allows Python developers to implement a compiler and virtual machine for their own language using a subset of Python called “RPython.” PyPy converts the developer’s custom VM into C using a sophisticated series of optimizations, and later compiles the C into fast, native machine language.</p><p>Let’s see how the same code looks in Python:</p><p><a
href="http://rubysource.com/?attachment_id=5846" rel="attachment wp-att-5846"><img
class="size-large wp-image-5846 alignnone" alt="topaz" src="http://cdn.rubysource.com/files/2013/06/python4.png" width="521" height="388" /></a></p><p>To me Python really seems like a sister language to Ruby. Aside from some minor differences around whitespace, colons and end keywords, the two languages are quite similar.</p><p>One important difference between the two is that Python doesn’t support closures in the same elegant way that Ruby does with blocks. The block parameter and invoke_block call here are part of the implementation of Ruby blocks for Topaz.</p><p>It’s almost as easy to read this code as it was to read the Rubinius implementation. Any additional code or verbosity here is just due to the details of the way Topaz works internally. I think I could become happy using Python if I spent some time learning to use the language &#8211; at least if my editor handled whitespace properly!</p><h2>Hash#fetch in JRuby</h2><p>The similarity between Ruby and Python become more obvious when you compare either of them with Java. To see what I mean, take a look at the JRuby implementation of Hash#fetch:</p><p><a
href="http://rubysource.com/?attachment_id=5849" rel="attachment wp-att-5849"><img
class="size-large wp-image-5849 alignnone" alt="jruby" src="http://cdn.rubysource.com/files/2013/06/java2.png" width="579" height="512" /></a></p><p>The same code is just a bit more verbose in Java than it was in Python or Ruby. Trying to read and understand this code takes a bit more effort than it did before. First you have to train your eyes not to see semicolons, parentheses or braces.</p><p>More importantly, the way Java works begins to get in the way of the algorithm. The clearest example of this is the use of an interface IRubyObject to handle the method’s arguments and return value. Since Java is a statically typed language, you have to worry about exactly what type of value each object is.</p><p>Depending on how you look at them, Java interfaces are either an awkward workaround for this problem, or an elegant way to insure each object provides the API you require, allowing the Java compiler to give you helpful error messages. But for me, they are unnecessary typing and thinking. I’m starting to forget what I was trying to achieve and worrying more about how the Java compiler works. The Java compiler should be making me happy, not the other way around!</p><h2>Hash#fetch in C</h2><p>Now let’s take a look at the official version of Hash#fetch. This is the C code that your Ruby program actually uses if you’re running Ruby 2.0:</p><p><a
href="http://rubysource.com/?attachment_id=5850" rel="attachment wp-att-5850"><img
class="size-large wp-image-5850 alignnone" alt="mri" src="http://cdn.rubysource.com/files/2013/06/c2.png" width="563" height="526" /></a><br
/> Now the level of verbosity jumps even more. In C, not only do we have the same static types we saw in Java, but now I have to worrying about pointers, memory management, and hardware optimizations using keywords such as “volatile.”</p><p>If you’re familiar with the idiomatic style of Ruby’s source code, with constructs like “RHASH,” “st_lookup” and “rb_scan_args,” then it’s not that hard to follow this. But there are still very confusing details here, such as the use of rb_protect to handle exceptions that might occur while generating the “key not found” error message.</p><p>Writing C code like this, I have to be completely aware of how each piece of data is represented by my computer’s hardware. How many bytes does it use? Does this API expect a value or a pointer? Do I need to free the memory this pointer references?</p><h2>Unfair Comparisons</h2><p>Of course, all of these languages are very different, intended for different purposes. C is really shorthand for writing assembly language, and, if used well, gives you tremendous control, flexibility and speed. Java allows you to write elegant, clean, and object oriented code without worry about hardware details or portability issues. And it still runs quite fast on the JVM. JRuby, in fact, is one of the fastest versions of Ruby around, faster than MRI Ruby in some cases.</p><p>My reason for comparing these languages to each other is to remind you of how happy you are writing Ruby. Don’t take it for granted! Matz and the Ruby core team have done a tremendous amount of work for the past 20 years to bring you programmer happiness.</p><p>And why have other talented open source developers worked so hard to reimplement Ruby using different languages, such as Java, Python or Ruby itself? Because they love Ruby also. They want to bring that happiness to their own platform or technology.</p> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/ruby-python-java-c-and-programmer-happiness/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>A Simple CMS in Sinatra, Part II</title><link>http://rubysource.com/a-simple-cms-in-sinatra-part-ii/</link> <comments>http://rubysource.com/a-simple-cms-in-sinatra-part-ii/#comments</comments> <pubDate>Thu, 30 May 2013 13:30:22 +0000</pubDate> <dc:creator>Darren Jones</dc:creator> <category><![CDATA[Sinatra]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5735</guid> <description><![CDATA[In part one we installed MongoDB and used Mongoid to create some pages for our Simple CMS. We also built a web front-end for adding and viewing pages. In this tutorial, we&#8217;re going to add the other two CRUD operations that will&#8230;]]></description> <content:encoded><![CDATA[<p><a
href="http://rubysource.com/?attachment_id=5737" rel="attachment wp-att-5737"><img
class="alignleft size-medium wp-image-5737" alt="Screenshot4" src="http://cdn.rubysource.com/files/2013/05/Screenshot4-300x227.png" width="300" height="227" /></a>In <a
href="http://rubysource.com/a-simple-content-management-system-in-sinatra/">part one</a> we installed MongoDB and used Mongoid to create some pages for our Simple CMS. We also built a web front-end for adding and viewing pages. In this tutorial, we&#8217;re going to add the other two CRUD operations that will allow users to edit and delete pages. Before we add the functionality, let&#8217;s add a couple of buttons to each page to allow you to edit or delete the page. Edit the <code>show.slim</code> file so that it looks like the following:</p><pre class="brush: xml; title: ; notranslate">
  a href=&quot;/pages/#{@page.id}/edit&quot; Edit this page,
  a href=&quot;/pages/delete/#{@page.id}&quot; Delete this page
</pre><h2>Editing Pages</h2><p>We need to create a route handler for when the user clicks on the edit page URL. Add the following to <code>main.rb</code> (but make sure that it goes before the &#8216;/pages/:id&#8217; route):</p><pre class="brush: ruby; title: ; notranslate">
  get '/pages/:id/edit' do
    @page = Page.find(params[:id])
    slim :edit
  end
</pre><p>This finds the page that is to be edited in the database using the id provided in the URL and stores it in an instance variable called <code>@page</code>. This will be accessible in the view, which is called <code>edit.slim</code>. We need to create that, so let&#8217;s do that now. Save the following as <code>edit.slim</code> in the <code>views</code> directory:</p><pre class="brush: xml; title: ; notranslate">
  h1 Edit Page
  form action=&quot;/pages/#{@page.id}&quot; method=&quot;POST&quot;
    input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;PUT&quot;
    fieldset
      legend Edit page
      == slim :form
    input type=&quot;submit&quot; value=&quot;Update&quot;
</pre><p>Notice that this reuses the <code>form</code> partial that we used for the <code>new</code> page in the last tutorial. This keeps things consistent and keeps our code DRY. The form refers to values in the <code>@page</code> object, so some of the fields should be filled in with their current values. The form also has a hidden field that is used to tell Sinatra that the request is a PUT request. This is because most browsers don&#8217;t natively support any HTTP verbs other than GET and POST. The solution is to use Sinatra&#8217;s method override so that the request will be routed as if it was a PUT request. We are using a PUT request in this case because we are updating the resource.</p><p>Next, we need to deal with what happens when the form is submitted. We need another route handler to deal with that, so add the following to <code>main.rb</code>:</p><pre class="brush: ruby; title: ; notranslate">
  put '/pages/:id' do
    page = Page.find(params[:id])
    page.update_attributes(params[:page])
    redirect to(&quot;/pages/#{page.id}&quot;)
  end
</pre><p>This finds the page that needs to be updated and updates it using Mongoid&#8217;s <code>update_attributes</code> method. It then redirects the user to the newly udpated page.</p><h2>Deleting Pages</h2><p>To delete a page, we are going to create a two-step process. First, we display a confirmation page to check that the user wishes to delete the page. Here is the route handler for that page:</p><pre class="brush: ruby; title: ; notranslate">
  get '/pages/delete/:id' do
    @page = Page.find(params[:id])
    slim :delete
  end
</pre><p>This route handler simply finds the page that is to be deleted and then shows a confirmation page. We need to create a view for this page, saved as <code>delete.slim</code> in the <code>views</code> directory:</p><pre class="brush: xml; title: ; notranslate">
  h1 Delete Page
  p Are you sure you want to delete the page called #{@page.title}?
  form action=&quot;/pages/#{@page.id}&quot; method=&quot;POST&quot;
    input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;DELETE&quot;
    input type=&quot;submit&quot; value=&quot;Delete&quot;
  a href=&quot;/pages&quot; cancel
</pre><p>We have to use a form to do this, as we will be using the DELETE HTTP method in our route handler that will delete the page. If we use a link then we can only use GET methods. We also need to use a hidden input field once again to use Sinatra&#8217;s method override, this time telling it to route the request as a DELETE method.</p><p>All that is left to do is add a route handler at the bottom of <code>main.rb</code> to deal with that request:</p><pre class="brush: ruby; title: ; notranslate">
    delete '/pages/:id' do
      Page.find(params[:id]).destroy
      redirect to('/pages')
    end
</pre><p>This simply finds the page and uses the <code>destroy</code> method to remove it from the database. It then redirects to the page index.</p><h2>Permalinks</h2><p>So far we have been using the id of the Page object as a URL. MongoDB uses very big ids, so this means we have URLS such as <code>/pages/5173f443a39401776a000001</code>. These are very long, and not very descriptive, so it would be nice if we could create a &#8216;pretty URL&#8217; based on the title of the page.</p><p>To do this we have to add a new field to our Page model called <code>permalink</code>. This can be done with the following line of code:</p><pre class="brush: ruby; title: ; notranslate">
  field :permalink, type: String, default: -&gt; { make_permalink }
</pre><p>This is not going to be a field that is filled in by the user in a form. It will be automatically created based on the title. We do this by using adding a default value that is set with a lambda that refers to a method called <code>make_permalink</code>. This method takes the title of the page and removes any spaces or punctuation with a hyphen (&#8216;-&#8217;) using various string methods. Here is the method, it just needs to go inside the <code>Page</code> class:</p><pre class="brush: ruby; title: ; notranslate">
  def make_permalink
    title.downcase.gsub(/\W/,'-').squeeze('-').chomp('-') if title
  end
</pre><p>We can test this functionality in IRB using the following lines of code:</p><pre class="brush: bash; title: ; notranslate">
  $&gt; irb
  2.0.0-p0 :001 &gt; require './main'
   =&gt; true
</pre><p>Now, search for the first document in our collection and you&#8217;ll find, amazingly, it already has a <code>permalink</code> field with an appropriate value:</p><pre class="brush: ruby; title: ; notranslate">
  2.0.0-p0 :002 &gt; Page.first
  =&gt; #This is our first page
&quot;, permalink: &quot;hello-world&quot;&gt;
</pre><p>Welcome to the world of schemaless databases! Unfortunately, things are not as good as we first thought because if we try to query based on this field, we get an error:</p><pre class="brush: ruby; title: ; notranslate">
  2.0.0p0 :003 &gt; Page.find_by(permalink: &quot;hello-world&quot;)
  Mongoid::Errors::DocumentNotFound:
</pre><p>This is because the <code>Page</code> object with its new <code>permalink</code> field needs to be saved. This is easily done using the following code:</p><pre class="brush: ruby; title: ; notranslate">
  2.0.0p0 :004 &gt; Page.first.save
   =&gt; true
</pre><p>Now we should be able to find the page using it&#8217;s permalink:</p><pre class="brush: ruby; title: ; notranslate">
  2.0.0p0 :005 &gt; Page.find_by(permalink: &quot;hello-world&quot;)
   =&gt; #This is our first page
&quot;, permalink: &quot;hello-world&quot;&gt;
</pre><p>Great! This means that every page created so far just needs to be saved to get it&#8217;s own permalink. If you have lots of pages, you can do this in one hit with the following line of code:</p><pre class="brush: ruby; title: ; notranslate">
  2.0.0p0 :007 &gt; Page.all.each{|page| page.save }
</pre><p>Everything seems to be working as it should. Now we just need to create the route handler for pretty URLS. These will simply be the permalink and won&#8217;t start with <code>/pages</code>. For example, going to <code>http://localhost:4567/hello-world</code> will show the page with the title of &#8220;Hello World!&#8221;. This route handler will actually match every route, so to allow other routes to get through we will use Sinatra&#8217;s <code>pass</code> method in a resuce block which will be invoked if the page cannot be found in the database.</p><p>Add the following code to <code>main.rb</code>:</p><pre class="brush: ruby; title: ; notranslate">
  get '/:permalink' do
    begin
      @page = Page.find_by(permalink: params[:permalink])
    rescue
      pass
    end
    slim :show
  end
</pre><p>This route handler will try to find the page based on the permalink given in the URL and store it in the <code>@page</code> instance variable before displaying the page using the <code>show</code> view that we have already created. If it can&#8217;t find the page in the database, then an error is thrown. The <code>rescue</code> method catches the error and calls the <code>pass</code> method, so Sinatra will simply move along to the next route to see if it matches.</p><h2>Adding Some Style</h2><p>Everything is working just as we want, but it all looks a bit nasty. Sinatra makes it really easy to use Sass to put together some nice stylesheets. All you need to do is add the following route handler to <code>main.rb</code>:</p><pre class="brush: ruby; title: ; notranslate">
  get('/styles/main.css'){ scss :styles }
</pre><p>Then place the following line in your layout file:</p><pre class="brush: ruby; title: ; notranslate">
  link rel=&quot;stylesheet&quot; href=&quot;/styles/main.css&quot;
</pre><p>Then create a file called <code>styles.scss</code> and save it in the <code>views</code> directory. This is where you put all of your styles.</p><p>Here is one I knocked together. It adds a bit of color, makes the form a bit nicer and makes some of the links and submit input fields look like buttons:</p><pre class="brush: css; title: ; notranslate">
  $blue: #0166FF;
  body{
    margin: 0;
    padding: 0;
    font: 13px/1.2 helvetica, arial, sans-serif;
  }
  h1,h2,h3,h4,h5,h6{
    color: $blue;
  }
  .logo {
    background: #444;
    margin: 0;
    padding: 20px 10px;
    font-size: 44px;
    a,a:visited{ color: $blue; text-decoration: none;}
  }
  .button{
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 4px;
    color: #fff;
    background: $blue;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    width: auto;
    &amp;:hover{
      background: darken($blue,20%);
    }
  }
  label{
    display: block;
    font-weight: bold;
    font-size: 16px;
  }
  form, input, textarea{
    width: 100%;
  }
  input, textarea {
    border: #ccc 1px solid;
    padding: 10px 5px;
    font-size: 16px;
  }
</pre><p>Note for some of these styles to work, you will need to add a class of <code>button</code> to the relevant elements in your views. For example, <code>show.slim</code> now looks like this:</p><pre class="brush: xml; title: ; notranslate">
  h1= @page.title
  - if @page.content
    == markdown @page.content
  a.button href=&quot;/pages/#{@page.id}/edit&quot; Edit
  a.button href=&quot;/pages/delete/#{@page.id}&quot; Delete
</pre><p>&#8230; and it looks a lot better for it!</p><p><a
href="http://rubysource.com/?attachment_id=5737" rel="attachment wp-att-5737"><img
class="size-medium wp-image-5737 alignnone" alt="Screenshot4" src="http://cdn.rubysource.com/files/2013/05/Screenshot4-300x227.png" width="300" height="227" /></a></p><h2>That&#8217;s All Folks!</h2><p>Now we have a fully functioning, albeit very simple, content management system. You can create, update, view and delete pages and they also have some pretty URLs based on their title. In the next part we&#8217;re going to create an admin section, flash messages, cache pages, versioning and timestamps. Please post in the comments any other features you&#8217;d like to see in the future.</p> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/a-simple-cms-in-sinatra-part-ii/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Interviewing Rogues: Avdi Grimm</title><link>http://rubysource.com/interviewing-rogues-avdi-grimm/</link> <comments>http://rubysource.com/interviewing-rogues-avdi-grimm/#comments</comments> <pubDate>Mon, 27 May 2013 13:30:04 +0000</pubDate> <dc:creator>Thom Parkin</dc:creator> <category><![CDATA[Interviews]]></category> <category><![CDATA[rogues]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5776</guid> <description><![CDATA[Avdi Grimm &#8211; A Happy Hacker Every week a group of Ruby Enthusiasts get together in a Virtual Roundtable and explore/discuss/argue some aspect of the Ruby language or the Ruby community. They allow the rest of us to listen in on their&#8230;]]></description> <content:encoded><![CDATA[<h3>Avdi Grimm &#8211; A Happy Hacker</h3><p><a
href="http://rubysource.com/interviewing-rogues-avdi-grimm/avdi/" rel="attachment wp-att-5777"><img
class="alignleft size-full wp-image-5777" alt="avdi" src="http://cdn.rubysource.com/files/2013/05/avdi.png" width="300" height="300" /></a>Every week a group of Ruby Enthusiasts get together in a Virtual Roundtable and explore/discuss/argue some aspect of the Ruby language or the Ruby community. They allow the rest of us to listen in on their discussion by way of The Ruby Rogues podcast. The podcast can be accessed on iTunes or on <a
href="http://www.rubyrogues.com">the website</a> and offers a ‘fly on the wall’ view of a great bunch of technology savvy people sharing their ideas and opinions.</p><p>In this series of articles I will share the results of my interviews with each member of this special group.</p><p>Avdi Grimm is a Hacker, an Author, a Podcaster, a Screencaster, an AirShip Entrepreneur.</p><p><strong>Thom:</strong> But as with anything like this, the very first question that comes to mind is, tell us a little bit about yourself.</p><p><strong>Avdi:</strong> First and foremost I’m a dad and a husband. As some folks know, we have five children. My first programming job was when, I was 18. I got a job with a defense contractor working mostly on Air Traffic Control systems. Although some of my early work I did some industrial automation and such.</p><p><strong>Thom:</strong> That’s pretty cool stuff, and that was with Java?</p><p><strong>Avdi:</strong> Actually, most of that early work was C++ and C, there was some assembly in there. Very little of the higher-level languages at that point, although later on in that job I did work with both Java and C#. That was mostly doing things like building testing tools; tools that didn’t actually run on the hardware. A lot of the work that I did was middleware, so I did stuff like implementing networking protocols.</p><p><strong>Thom:</strong> That sounds cool.</p><p><strong>Avdi:</strong> And when you’re trying to pass packets around really fast and you need to talk to the operating system, networking APIs, C++ or C is often a good choice, especially back then. Java and stuff like that were really kind of immature for that type of work.</p><p>A lot of the work that I did on middleware used the ACE libraries and these are the libraries that Doug Schmidt created and he probably still has them up &#8211; you know he’s one of the patterns pioneers, particularly one of the concurrency patterns pioneers &#8211; and ACE is the framework where things like the Reactor Pattern first appeared. So some of the earliest work in what we now call <em>Evented Programming</em>, where you take the operating system primitives, like Select or other kind of asynchronous primitives, and you wrap that in nice, higher-level <code>OO</code> abstractions like a Reactor or a Proactor, or a Future.</p><p><strong>Thom:</strong> Right. Tell me about the transition then, from something like that to Ruby. Was it like the story most of us tell; Rails and the Web drew you to Ruby? Or because you were doing testing and other control systems, perhaps you went straight to the Ruby language?</p><p><strong>Avdi:</strong> It’s always been about a combination of pragmatism and curiosity for me. Very early on in that job, partly just as a matter of interest and curiosity, I did a lot of reading up on the existing scripting languages that were out there. Obviously, Python was already moderately well established. Perl was quite well established. And that’s actually one of the first scripting languages I learned &#8211; Perl &#8211; because the task at hand, where I decided it was time to learn Perl was. We had these huge mini-Gigabyte dumps of a particular low-level serial protocol and we needed to analyze them. There was documentation for the protocol, but we knew that the documentation was at least partially wrong. So we needed to analyze these huge dumps of actual network traffic to find out what the packets really looked like as opposed to what the documentation claimed they looked like.</p><p>I decided everybody used stuff like C and C++ for everything there, but being the young punk that I was, I decided that I could probably be a lot more productive if I wrote analysis tools with a higher level language like Perl.</p><p><strong>Thom:</strong> Right, that’s what Perl’s designed to do.</p><p><strong>Avdi:</strong> Right. It’s the Swiss Army Chainsaw for ripping through data.</p><p><strong>Thom:</strong> Exactly.</p><p><strong>Avdi:</strong> I had known about it and I decided at that point, “Okay, I’m going to learn this.” I got the Camel book and I just poured over it for days on end, and I wrote some pretty useful software in Perl. I was just really interested in all the scripting languages and kept learning about them.</p><p>At one point in 2001, I kicked off a little personal project where I learned Ruby and Python concurrently and did some of the same examples in each one. At the end of that I was just really, really impressed with Ruby.</p><p>So I started writing little things that would help me get my job done a bit faster in Ruby. Since a lot of the workstations there were Windows workstations, I messed around with automating Excel using Ruby instead of using VBA. Even back then, the Ruby Windows distributions came with the Win32 OLE library. I also did some stuff involving preprocessing and munging binary images which were going to be burnt onto PROMs &#8211; which is what you had before embedded systems had flash memory.</p><p><strong>Thom:</strong> That sounds like fun stuff.</p><p><strong>Avdi:</strong> Yes, so I was basically writing these programs to preprocess binary images and I was doing that in Ruby.</p><p><strong>Thom:</strong> It’s the true spirit of hacking. Personally, I appreciate your little sign-off on your <a
href="http://RubyTapas.com">Ruby Tapas</a> because I’ve always been an old-schooler that argues the huge difference between <strong>Hacking</strong> and <strong>Cracking</strong>. Having gone through a career in telecommunications, the whole idea of cracking is very familiar to me. The general public tends to have the concept that <code>Hackers</code> are bad. I make the distinction that a <code>hacker</code> is just someone who’s infinitely curious and continually disassembling and deconstructing things in an effort to better understand them.</p><p><strong>Avdi:</strong> True.</p><p><strong>Thom:</strong> In contrast, a <code>Cracker</code> is a person nefariously trying to steal from others. What you describe there sounds like the true spirit of hacking.</p><p><strong>Avdi:</strong> As long as I’ve known about it, I’ve identified very strongly with the <code>Hacker</code> ethos. In that classical sense. Once I discovered the kind of UNIX hacker history, I just dug into it and started using Linux for my primary operating system.</p><p>Obviously I didn’t come up with the sign off “Happy Hacking,” that’s something that Free Software Foundation people have been saying for years and I’m sure others as well. I like that it’s about hacking, because I think that’s not a dirty word, like you said, but I also like that it’s about joy, because I think one of the things I most want to project in a lot of the stuff that I put out &#8211; particularly <a
href="http://RubyTapas.com">Ruby Tapas</a> &#8211; is the joy of coding. One of the things that drew me to Ruby in the first place is the fact that it is a language that was deliberately created to be optimized for <strong>programmer happiness</strong> as opposed to various other more academic optimizations.</p><p><strong>Thom:</strong> That’s a fine way to put it. I agree.</p><p><strong>Avdi:</strong> Well, and that’s what Matz has said about it and that was his intent and it really shows through in the language. I think it has already shown through in the community and still does to this day.</p><p><strong>Thom:</strong> So you took us there; How did <a
href="http://RubyTapas.com">Ruby Tapas</a> emerge? I am certain there’s an interesting story behind that.</p><p><strong>Avdi:</strong> I’ve been trying to figure that out lately. *chuckle*<br
/> It was an idea that came to me, I think over a year before I actually managed to launch it. But thinking back now, I can’t actually remember what was that crystallizing moment when I realized, “What if I did really short videos about Ruby?” I had been thinking about screencasting for a long time and I’ve been dabbling in releasing little, incredibly poor quality screencasts on my blog from time to time when there was something that felt it would be hard to demonstrate using just text.</p><p>But part of the idea of doing a service was just sheer economic business pragmatism. I am a sole earner for our whole family and I’d been consulting for a while and I’d been augmenting our income with some of the books that I’d released and that was a nice source of secondary income. But it was also kind of tough sometimes when I would have a couple of consulting clients and also be trying to keep up with book writing and then sometimes with consulting. The difficulty in managing all that; sometimes it pours and then sometimes it’s dry.</p><p>I had been looking for a way to come up with more of a smooth, even source of income while still doing the stuff that I love. I love coding, but I also love writing about code and the screencasts are really just an extension of writing about code. They’re kind of an excuse to write all the blog posts that I never got around to writing.</p><p>At some point it occurred to me that a lot of screencasts seemed like it’s hard to find time for them. So I thought that I’d try my hand at really short ones and see if I could cram just one piece of knowledge into a single short screencast at a time.</p><p><strong>Thom:</strong> I think that is your &#8220;Secret Sauce&#8221;, the magic formula. I feel the same way. Five minutes is not only easily digestible, more importantly, I’m less likely to procrastinate watching it. I will devote the time if I know that it’s finite and I know what it is, I will spend the time to go through it.</p><p><strong>Avdi:</strong> I’m in a very lucky situation. It’s kind of a positive reinforcement system now where I get to see a lot of feedback from the community, both as a Ruby Rogue and speaker and screencaster, et cetera. I get to see a lot of people talking about different techniques and different features of the language. People send stuff my way, I get emails with suggestions for topics or people tweet at me asking about a particular thing.</p><p>I benefit a lot from the community and I try to share the things that people send my way.</p><p><strong>Thom:</strong> Terrific. I need to guide the conversation now to the Ruby Rogues. We&#8217;ve read from other Rogues on this, but from you, how did you discover them or how did they discover you? How did you become a Ruby Rogue?</p><p><strong>Avdi:</strong> Ruby Rogue is the podcast I always wanted to create but I never did. Instead, Chuck and James got to it before me.</p><p>I love the panel format on podcasts, I’d listened to CNET’s <a
href="http://www.cnet.com/buzz-out-loud-podcast/">Buzz Out Loud</a> for years. There’s a Java podcast which &#8211; what am I doing listening to a Java podcast?! &#8211; but it’s actually a bunch of really smart people, in a panel format, and it is a lot of fun. So I always thought it would be cool to have a podcast like that for Ruby and then I got really excited when I saw that Chuck and James and some others had started to put one together. I listened to it and then I guess they knew about me through my blogging and books and stuff. One day they were missing a panelist and kind of at the last minute said, “Hey, do you want to join us?” and I was like, “Heck, yes!”</p><p>Basically the same thing happened again a couple of weeks later; missing a panelist, they didn’t have one of the regulars and they invited me on again. After that, I was incredibly lucky to be invited to stay.</p><p><strong>Thom:</strong> You’re very busy, obviously with <a
href="http://RubyTapas.com">Ruby Tapas</a>, I’m sure. I know from experience that developing something like that takes four or five times the amount of time of the final product, and that’s not counting any of the missteps or re-do or anything you have to do in post-production.</p><p><strong>Avdi:</strong> A single five-minute video I would say takes somewhere between four and eight hours to put together. When you consider coming up with the idea, honing the code for it, then writing out the script, then recording the screen for the different parts of the screencast, doing the voiceover, and then editing. When you put all that together.</p><p><strong>Thom:</strong> Yes, you’re building a curriculum for each one and it’s a complete module in itself.</p><p><strong>Avdi:</strong> Right.</p><p><strong>Thom:</strong> Do you have any idea of perhaps packaging them into little groups and selling them in a different way as bundles of some sort?</p><p><strong>Avdi:</strong> I think about stuff like that, but it’s not something I’m going to be doing any time soon. But yeah, I think probably eventually I’ll do something along those lines.</p><p><strong>Thom:</strong> For clarification, <a
href="http://rubytapas.com">Ruby Tapas</a> is a subscription service where you get access to all of them, historically, right?</p><p><strong>Avdi:</strong> That is correct.</p><p><strong>Thom:</strong> It includes the source code and I notice there’s been some active discussions in the comments also, which I think is a great adjunct. When somebody smarter than me makes a comment about something that you brought up and then there’s a little interchange there, I always learn something. It’s a brilliant formula.</p><p><strong>Avdi:</strong> Thanks, it’s been working out really well.</p><p><strong>Thom:</strong> Do you have ideas of extending it to maybe other things? Other than just Ruby?</p><p><strong>Avdi:</strong> Well, I’ll say this much. I reserved CodeTapas.com on the same day that I reserved RubyTapas.com.</p><p><strong>Thom:</strong> Ah, very interesting.</p><p><strong>Thom:</strong> The last thing I wanted to ask you about is recently I saw that you generated a kind of&#8230;</p><p><strong>Avdi:</strong> A meme, almost.</p><p><strong>Thom:</strong> Yes, a meme. Which was a result of your talk at the <a
href="http://www.ancientcityruby.com/">Ancient City Ruby</a> here in Florida. But tell that story for me, please.</p><p><strong>Avdi:</strong> I spent the latter half of 2012 as a consulting pair-programmer. I came to the end of my current consulting jobs and rather than looking for a new regular consulting jobs, I started taking appointments for pair-programming. People would sign up with me and pair-program with me for two hours at a time on whatever they wanted. A lot of these were paid, because this was my job, but I also tried to make time for a free one every week, those were always on Open Source software.</p><p>It was a tremendous experience. I’d been a fan of pair-programming for a long time anyway, but it really just kind of cemented in my mind the value of pairing. Not just pairing, but pairing diversely. I learned a tremendous amount, I like to think that all the people I paired with learned something and certainly I got a lot of very nice comments from them.</p><p>One of my favorites was always when people would end the session with, “Wow, I actually understand my own code a lot better now.” It cemented in my mind how valuable it is, first of all, to practice programming socially. A lot of the people I worked with didn’t have opportunities to pair program or to program with others in any form, or didn’t have a lot of opportunities for that, maybe they were just isolated somehow, they were not in some tech hub and they didn’t have a lot of programmers around or they were the only programmer on their team or something like that.</p><p>I could see the value that they were getting from it. Thinking about it, I realized that I really wanted to encourage more programmers to not just pair-program within their own companies, but to pair up diversely; to go out and seek other programmers to pair with on different projects, on their own projects, on other projects, or on Open Source projects, and learn.</p><p>For me it’s all about diversity. We know that Biological communities are strengthened by genetic diversity, and I feel like in a very similar way, our community is strengthened by mimetic diversity; a diversity of ideas. There are so many good parts to having somebody else’s perspective. You find new ways to solve problems, you find new ways to think about problems, and there’s this whole psychological aspect to it where working with a lot of other programmers, it just gives you a more three-dimensional and a more positive feeling for the other people working in your field. You realize they’re all human, they are neither gods nor devils, and sometimes I see kind of little explosion of cynicism. Maybe I spend too much time on Twitter, but I see little outbreaks of cynicism in the community and I feel like if people spent less time sort of tweeting at each other grumpily and more time pairing up &#8211; working together, hearing each other’s voices, maybe seeing each other on video, or if they are able to, in person — they would be happier programmers. And they would have better feelings for the rest of the community and just generally have a better time. It’s all about happy hacking.</p><p>That was basically the idea and I decided to kind of kick off a personal campaign to get programmers to pair up with each other more and I launched that at <a
href="http://www.ancientcityruby.com/">Ancient City Ruby</a> with my talk there. I launched a tiny website in conjunction with that, <a
href="http://PairProgramWith.me">PairProgramWith.me</a>, which had, at the time of launch, nothing other than a badge that you could download that said, “Pair with Me” to stick on your website.</p><p>The idea is that I’m not really trying to solve a technical problem here. The main thing I’m trying to solve is a social problem where I think that people feel like they can’t ask. I think most programmers, if they thought about it for a little while, they could think of someone they’d love to pair-program with. But it’s just like asking, “Hey, can I pair program with you,” out of the blue is not a thing in our community and I want to make it a thing.</p><p><strong>Thom:</strong> Well, thanks. Avdi, can we pair-program sometime in the near future?</p><p><strong>Avdi:</strong> Sure. That would be great.</p><p>Avdi Grimm is quite a prominent figure in the Ruby (and Rails) community. You can find him:</p><ul><li><a
href="https://github.com/avdi">Github</a></li><li><a
href="http://avdi.org">Blog</a></li><li><a
href="https://twitter.com/avdi">Twitter</a></li><li><a
href="https://shiprise.dpdcart.com/">Books</a></li><li><a
href="http://www.wideteams.com/">WideTeams Podcast</a> and <a
href="http://rubyrogues.com">Ruby Rogues podcast</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/interviewing-rogues-avdi-grimm/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <series:name><![CDATA[Interviewing Rogues]]></series:name> </item> <item><title>Simple Background Jobs with Sucker Punch</title><link>http://rubysource.com/simple-background-jobs-with-sucker-punch/</link> <comments>http://rubysource.com/simple-background-jobs-with-sucker-punch/#comments</comments> <pubDate>Thu, 23 May 2013 13:30:33 +0000</pubDate> <dc:creator>Esteban Pastorino</dc:creator> <category><![CDATA[Gems]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5739</guid> <description><![CDATA[Running background jobs in an app is a great way to keep the UI snappy. Being it sending an email, calling some API, or any long running task, there&#8217;s always something that can be moved to the background. Sometimes, it makes sense&#8230;]]></description> <content:encoded><![CDATA[<p><a
href="http://rubysource.com/simple-background-jobs-with-sucker-punch/suckerpunch/" rel="attachment wp-att-5740"><img
class="alignleft size-medium wp-image-5740" alt="suckerpunch" src="http://cdn.rubysource.com/files/2013/05/suckerpunch-300x130.png" width="300" height="130" /></a>Running background jobs in an app is a great way to keep the UI snappy. Being it sending an email, calling some API, or any long running task, there&#8217;s always something that can be moved to the background. Sometimes, it makes sense to set up a queue and worker processes, but other times it would be great just to have the method run in background with minimal code changes. Enter <a
href="https://github.com/brandonhilkert/sucker_punch">Sucker Punch</a>, a single-process asynchronous processing library. Using the wonderful <a
href="https://github.com/celluloid/celluloid/">celluloid</a> framework, it lets us do asynchronous work in very few steps.</p><h2>Setup</h2><p>First of all, your app needs to be running on Ruby 1.9+, JRuby 1.6+ or Rubinius 2.0 (with Ruby 1.9 mode on the last 2). Then, install the gem by running</p><pre class="brush: bash; title: ; notranslate">
gem install sucker_punch
</pre><p>or add it to you Gemfile via</p><pre class="brush: ruby; title: ; notranslate">
  gem 'sucker_punch'
</pre><p>And that&#8217;s it! Now lets see how to use it.</p><h2>Creating a Worker</h2><p>Creating a worker is pretty simple. It&#8217;s just a plain ruby class that includes the <code>SuckerPunch::Worker</code> module, and defines one or more instance methods. Sucker Punch suggests just one <code>perform</code> method, but any name and number of methods can be defined and used.</p><pre class="brush: ruby; title: ; notranslate">
  class SomeWorker
    include SuckerPunch::Worker
    def perform(some_data)
      # Method code. Do some work.
    end
  end
</pre><h2>Calling the Worker</h2><p>Before calling the worker, we need to configure our queues:</p><pre class="brush: ruby; title: ; notranslate">
  SuckerPunch.config do
    queue name: :some_queue, worker: SomeWorker, workers: 5
    queue name: :welcome_queue, worker: WelcomeEmailWorker, workers: 2
  end
</pre><p>We can define as many queues as we want with as many workers as we want (preferable 2+ per queue), but each can have only one worker class per queue.<br
/> More workers equals more parallel jobs that can be performed, but be aware of running out of connections if you&#8217;re using a connecting to an external service like a database or memcached.<br
/> Then you can access the workers on the queues via</p><pre class="brush: ruby; title: ; notranslate">
  SuckerPunch::Queue[:some_queue] # or
  SuckerPunch::Queue.new(:some_queue)
</pre><p>This will give us a <code>Celluloid::ActorProxy</code> object wrapping our worker object.<br
/> We can call the <code>perform</code> method (or any other method we defined) on that object directly, or use <code>async</code> to return control instantly and make it run in background.</p><pre class="brush: ruby; title: ; notranslate">
  SuckerPunch::Queue[:welcome_queue].perform(1)
  SuckerPunch::Queue[:welcome_queue].async.perform(1)
</pre><p>Just be aware that running the job async will not raise any exception if it fails. It will just fail silently.</p><h2>Testing</h2><p>Everything needs testing, of course!</p><p>Fortunately, testing the worker is pretty easy. You can test it as any Ruby class.</p><p>With some rspec flavor:</p><pre class="brush: ruby; title: ; notranslate">
describe WelcomeEmailWorker
  let(:user){ FactoryGirl.create :user }
  let(:worker){ EmailWorker.new }
  describe &quot;#perform&quot; do
    it &quot;delivers an email&quot; do
      expect{ worker.perform(user.id) }.to change{ UserMailer.deliveries.size }.by(1)
    end
  end
end
</pre><p>To test how it integrates with other methods, there are 2 options:</p><p>1) Test that it calls and enqueues the job. To do this you need to require <code>'sucker_punch/testing'</code>:</p><pre class="brush: ruby; title: ; notranslate">
require 'sucker_punch/testing'
describe User do
  describe &quot;#send_welcome_email&quot; do
    it &quot;delivers an email&quot; do
      let(:user){ FactoryGirl.create :user }
      expect{
        user.send_welcome_email
      }.to change{ SuckerPunch::Queue.new(:email).jobs.size }.by(1)
    end
  end
end
</pre><p>2) Running jobs inline. This can be done by requiring <code>'sucker_punch/testing/inline'</code>, and jobs will <em>always</em> be run synchronously.</p><pre class="brush: ruby; title: ; notranslate">
require 'sucker_punch/testing'
describe User do
  let(:user){ FactoryGirl.create :user }
  describe &quot;#send_welcome_email&quot; do
    it &quot;delivers an email&quot; do
      expect{
        user.send_welcome_email
      }.to change{ UserMailer.deliveries.size }.by(1)
    end
  end
end
</pre><h2>Considerations</h2><h3>Tests Running Inside DB Transactions</h3><p>There&#8217;s one thing to have in mind with tests. If you&#8217;re running each test inside a transaction, you&#8217;ll need to change that to a truncation strategy for Sucker Punch tests. Here&#8217;s an example of how to do it with DatabaseCleaner: <a
href="https://gist.github.com/kitop/5248674">https://gist.github.com/kitop/5248674</a>. This happens because Sucker Punch workers always run the method in a separate thread, no matter if it is synchronous or asynchronous.</p><h3>Persistence</h3><p>Keep in mind that Sucker Punch runs your jobs on a separate thread, and not polling from an outside queue. That means that, if your app goes down while processing a job, it will not notify nor store that error anywhere by default, and it won&#8217;t retry it either. If you need more control over this, you can write your own wrapper. Maybe you could get some inspiration from <a
href="https://github.com/mperham/girl_friday/blob/master/lib/girl_friday/persistence.rb">girl_friday</a>, or use some other solution like <a
href="https://github.com/resque/resque">resque</a>, <a
href="https://github.com/mperham/sidekiq">sidekiq</a>, or <a
href="https://github.com/tobi/delayed_job">delayed_job</a>.</p><h3>Rails</h3><p>If you&#8217;re working with Rails, workers usually go in the <code>app/workers</code> directory. You should be careful with ActiveRecord objects and connections. Workers should receive a record id and not the full object. Preferably, workers should wrap database access related code in a <code>ActiveRecord::Base.connection_pool.with_connection</code> block so it does not exhaust connections in the pool.</p><pre class="brush: ruby; title: ; notranslate">
class WelcomeEmailWorker
  include SuckerPunch::Worker
  def perform(user_id)
    ActiveRecord::Base.connection_pool.with_connection do
      user = User.find(user_id)
      UserMailer.welcome(user).deliver
    end
  end
end
</pre><h3>Connections</h3><p>You have to be careful not just with ActiveRecord connections, but also with any redis, memcache, or any other service that may limit connections. It&#8217;s important to also limit the number of workers based on those limits. You don&#8217;t want to have 20 workers, when there are 10 connections max!</p><h3>Unicorn/Passenger</h3><p>If you&#8217;re using Unicorn or Passenger as your web server, there&#8217;s one more step to ensure everything is set up well. That is to define the queues on blocks that run after the server. For unicorn (only needed if <code>preload_app true</code> is set):</p><pre class="brush: ruby; title: ; notranslate">
# config/unicorn.rb
after_fork do |server, worker|
  SuckerPunch.config do
    queue name: :log_queue, worker: LogWorker, workers: 10
  end
end
</pre><p>For Passenger:</p><pre class="brush: ruby; title: ; notranslate">
# config/initializers/sucker_punch.rb
if defined?(PhusionPassenger)
  PhusionPassenger.on_event(:starting_worker_process) do |forked|
    SuckerPunch.config do
      queue name: :log_queue, worker: LogWorker, workers: 10
    end
  end
end
</pre><h3>Further Reading:</h3><ul><li><a
href="https://devcenter.heroku.com/articles/concurrency-and-database-connections#connection-pool">Concurrency and Database Connections, Heroku Dev Center</a></li><li><a
href="https://github.com/celluloid/celluloid/wiki/Frequently-Asked-Questions">Celluloid&#8217;s Frequently Asked Questions</a></li><li><a
href="https://github.com/celluloid/celluloid/wiki/Thread-safety-notes">Celluluid&#8217;s Thread safety notes</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/simple-background-jobs-with-sucker-punch/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Git: Simply Stashing</title><link>http://rubysource.com/git-simply-stashing/</link> <comments>http://rubysource.com/git-simply-stashing/#comments</comments> <pubDate>Mon, 20 May 2013 13:30:54 +0000</pubDate> <dc:creator>Jonathan Jackson</dc:creator> <category><![CDATA[Outside Ruby]]></category> <category><![CDATA[git]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5741</guid> <description><![CDATA[Most Rubyists find themselves using Git on a day-to-day basis. We use it to organize our projects, protect ourselves from errors, and to make changes with the confidence that our code is safe. Its simple command line interface belies its flexibility and&#8230;]]></description> <content:encoded><![CDATA[<p><a
href="http://rubysource.com/?attachment_id=5742" rel="attachment wp-att-5742"><img
class="alignleft size-medium wp-image-5742" alt="stash" src="http://cdn.rubysource.com/files/2013/05/stash-300x168.png" width="300" height="168" /></a>Most Rubyists find themselves using Git on a day-to-day basis. We use it to organize our projects, protect ourselves from errors, and to make changes with the confidence that our code is safe. Its simple command line interface belies its flexibility and depth. Because of this power, it definitely merits deep study and practice.</p><p>Today, I want to discuss a few of the techniques that I use to make swapping branches easier, specifically the <code>git-stash</code> command.</p><p><code>git-stash</code> is a wonderful way to temporarily hide changes in a dirty working directory. This allows us to work on a feature branch and quickly swap to other branches without the bother of staging / commiting our changes first.</p><p><a
href="http://rubysource.com/?attachment_id=5745" rel="attachment wp-att-5745"><img
class="alignnone size-medium wp-image-5745" alt="typical-stash-workflow" src="http://cdn.rubysource.com/files/2013/05/typical-stash-workflow-172x300.png" width="172" height="300" /></a><br
/> <small>[Typical Stash Workflow]</small></p><p>If you are like most developers, then the extent of your experience with <code>git-stash</code> extends no further than the following two commands:</p><pre class="brush: bash; title: ; notranslate">
git stash
</pre><p>and</p><pre class="brush: bash; title: ; notranslate">
git stash pop
</pre><p>Often, this is enough for what we need, but <code>git-stash</code> has so much more to offer. Let&#8217;s explore some of its myriad abilities.</p><h2>Saving With a Description</h2><p>The simplistic approach to stashing is <code>git stash</code> and is analogous (mostly) to <code>git stash save</code>. The latter takes several arguments, most important of which is a description. If you are going to use stash as part of your normal workflow you <strong>must</strong> use these descriptions to keep better control of each stash. Let&#8217;s see how that&#8217;d work:</p><pre class="brush: bash; title: ; notranslate">
touch gum_drop_mountains.rb   # New feature
git add .                     # git-stash only works on tracked files
                              # unless you pass the --include-untracked flag
                              # to stash save
git stash save &quot;Initial pass on Gum Drop Mountains.&quot;
git stash list
stash@{0}: On master: Initial pass on Gum Drop Mountains.
</pre><p>Now when we view the current stash list we see meaningful messages instead of the default description <code>WIP on &lt;branch&gt; &lt;last commit message&gt;</code>.</p><h2>Stashing In Patches</h2><p>Sometimes you want to stash a specific subset of changes, for this we can use the <code>--patch</code> (<code>-p</code>) flag. This allows us to interactively specify which changes will be included in this stash.</p><pre class="brush: bash; title: ; notranslate">
# edit gum_drop_mountain.rb
git stash save -p &quot;Added GDM tests&quot;
</pre><p>Which will drop you into a prompt like below:</p><p><a
href="http://rubysource.com/?attachment_id=5746" rel="attachment wp-att-5746"><img
class="alignnone size-large wp-image-5746" alt="git-stash-p" src="http://cdn.rubysource.com/files/2013/05/git-stash-p-530x223.png" width="530" height="223" /></a></p><p>Once you&#8217;ve begun the interactive process, you can press <code>?</code> to see a list of available commands. Upon completion you&#8217;ll be able to see your new stash with <code>git stash list</code>. The changes that are left uncommitted (to the stash) will still be in your current directory.</p><h2>Listing Stashes</h2><p>The most common way to view your current stashed changes is to type <code>git stash list</code> as we touched on earlier. This will print:</p><pre class="brush: bash; title: ; notranslate">
# Unless you are cool and passed a description
stash@{0}: WIP on submit: 6ebd0e2... Initial Commit.
stash@{1}: On master: 9cc0589... Add git-stash
</pre><p>Here, the stashes are specified as <code>stash@{&lt;revision&gt;}</code>. Many of the <code>git-stash</code> commands allow this stash identifier to be explicitly set, making it an important piece of information. <code>git stash list</code> takes any of the options accessible to <code>git log</code> which allows for some customization.</p><pre class="brush: bash; title: ; notranslate">
git stash list --pretty=format:'%Cblue%h %Cred* %C(yellow)%s'
</pre><p>Which will output something like:</p><p><a
href="http://rubysource.com/?attachment_id=5747" rel="attachment wp-att-5747"><img
class="alignnone size-large wp-image-5747" alt="pretty-format" src="http://cdn.rubysource.com/files/2013/05/pretty-format-530x26.png" width="530" height="26" /></a></p><p>You can alias <code>git-log</code> with the above formatting, which is common. Doing so with the git stash list is a prime candidate for this style of optimization, as being able to quickly decipher these descriptions can save you time.</p><h4>Showing Individual Stashes</h4><p>Showing stashes can be done with the <code>git stash show</code> command. It accepts an argument for the stash identifier and defaults to <code>stash@{0}</code> (most recent). It will display the diffstat by default.</p><h2>Applying Stashes</h2><p>Let&#8217;s assume we&#8217;ve been working for few hours. During this time we&#8217;ve been pulled off several times to work on other branches in the project. As we were pulled away, we&#8217;ve stashed our dirty working directories and given them all nice messages so we can cobble it all together later. Now that the bugs are fixed, we get to go back to our features. Our stash list looks like this:</p><pre class="brush: bash; title: ; notranslate">
git stash list
stash@{0}: On gum_drop_mountain: Touching up gum drop mountain peaks.
stash@{1}: On candy_cane_lane: Adding some tinsel to candy cane lane
stash@{2}: On master: First pass on gum drop mountains.
</pre><p>We want to go back to the <code>candy_cane_lane</code> feature branch and apply our stashed changes there. To do so, we are going to use the <code>git stash apply</code> command.</p><pre class="brush: bash; title: ; notranslate">
git checkout candy_cane_lane
git stash apply stash@{1}    # Specified stash or most recent (stash@{0})
</pre><p>Once we&#8217;ve done that, our changes are back in their proper place and we can resume work.</p><p>Git is smart here, in that you can apply these changes to branches other than the branch from which they were stashed. Furthermore, the branch you apply the changes to doesn&#8217;t have to be a clean directory! Git will throw a merge conflict to be manually resolved if the stash no longer applies cleanly[1].</p><h2>Removing Stashes</h2><p>Just for funzies, let&#8217;s check the stash list before moving on.</p><pre class="brush: bash; title: ; notranslate">
git stash list
stash@{0}: On gum_drop_mountain: Touching up gum drop mountain peaks.
stash@{1}: On candy_cane_lane: Adding some tinsel to candy cane lane
stash@{2}: On master: First pass on gum drop mountains.
</pre><p>What? Our stash is still present in our list even after applying it. That&#8217;s because <code>apply</code> doesn&#8217;t automatically clean up after itself, we have to use the following command to remove the stash</p><pre class="brush: bash; title: ; notranslate">
git stash drop stash@{1}
</pre><p>Which will drop just the stash we applied. Had we not given it a stash identfier it would have assumed we meant to drop <code>stash@{0}</code> (most recent). If we want to be rid of all stashed changes we can run <code>git stash clear</code>. <strong>Beware</strong> of clearing stashes (with either drop or clear) as they are <strong>impossible</strong> to recover.</p><h2>The Oh-So Convenient Pop</h2><p>After applying a stash of changes to a branch, it is quite frequently a good idea to remove that stash from the list (like above). Luckily, Git provides us with a convenient method that wraps this workflow. Assume we want to apply <code>stash@{1}</code> and remove it from the stash list. We can run the following command:</p><pre class="brush: bash; title: ; notranslate">
git stash pop stash@{1}
</pre><p>If we provide no stash identifier, it would assume most recent (like most <code>git-stash</code> commands). The <code>git-stash</code> <a
href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html">man page</a> provides a good way of thinking about this command. That it does the inverse of <code>git stash save</code>.</p><h2>Branching a Stash</h2><p>Sometimes you&#8217;ll find yourself in a situation where you&#8217;ve begun changes on the wrong branch (master for example) and want to take your current dirty directory to its own branch. Well you are in luck! Normally you&#8217;d have to do something like this:</p><pre class="brush: bash; title: ; notranslate">
git stash
git checkout -b new_feature
git stash pop
</pre><p>But <code>git-stash</code> has a convenience method to do just this. Simply:</p><pre class="brush: bash; title: ; notranslate">
git stash
git stash branch new_feature
</pre><p>This will create and checkout a new branch <code>new_feature</code> and apply <code>stash@{0}</code> to it.</p><h2>To Stash or Not To Stash</h2><p>Determining when to stash versus when to commit and squash later is a matter of taste. As long as you write descriptive messages about the stash and be sure to keep your stash list clean, then stashing is a great way to quickly get to a clean directory. If, on the other hand, you don&#8217;t take care, you&#8217;ll find yourself painfully wasting time figuring out which stash is which.</p><p>Warnings aside, stashing is a powerful ability that Git provides and with a little practice it can help you navigate your code more quickly and safely. Happy hacking!</p><h4>Resources</h4><ol><li><a
href="http://git-scm.com/book/en/Git-Tools-Stashing">Pro Git (stashing)</a></li><li><a
href="http://gitready.com/">git ready</a></li><li><a
href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html">git-stash man page</a></li></ol> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/git-simply-stashing/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Interviewing Rogues: David Brady</title><link>http://rubysource.com/interviewing-rogues-david-brady/</link> <comments>http://rubysource.com/interviewing-rogues-david-brady/#comments</comments> <pubDate>Thu, 16 May 2013 13:30:15 +0000</pubDate> <dc:creator>Thom Parkin</dc:creator> <category><![CDATA[Interviews]]></category> <category><![CDATA[rogues]]></category> <guid
isPermaLink="false">http://rubysource.com/?p=5717</guid> <description><![CDATA[David Brady &#8211; Learning and Laughing Every week a group of Ruby Enthusiasts get together in a Virtual Roundtable and explore/discuss/argue some a spect of the Ruby language or the Ruby community. They allow the rest of us to listen in on&#8230;]]></description> <content:encoded><![CDATA[<h2><span
style="font-size: 1.5em"><a
href="http://rubysource.com/interviewing-rogues-david-brady/db/" rel="attachment wp-att-5721"><img
class="alignleft size-medium wp-image-5721" alt="db" src="http://cdn.rubysource.com/files/2013/05/db-300x300.png" width="300" height="300" /></a>David Brady &#8211; Learning and Laughing</span></h2><p>Every week a group of Ruby Enthusiasts get together in a Virtual Roundtable and explore/discuss/argue some a<br
/> spect of the Ruby language or the Ruby community. They allow the rest of us to listen in on their discussion by way of The Ruby Rogues podcast. The podcast can be accessed on iTunes or on <a
href="http://www.rubyrogues.com">the website</a> and offers a ‘fly on the wall’ view of a great bunch of technology savvy people sharing their ideas and opinions.</p><p>In this series of articles I will share the results of my interviews with each member of this special group.</p><h2>Beginning with &#8220;The Basics&#8221;</h2><p><strong>Thom:</strong> Like any interview, in a podcast or in writing, the first question of course is; &#8220;David, please tell us about yourself.&#8221;"</p><p><strong>David:</strong> No, next question.</p><p><strong>Thom:</strong> Okay. That was a short interview!!</p><p><strong>David:</strong> No, I’m kidding&#8230;</p><p>I am kind of an old-school programmer, kind of self-taught. I grew up in rural Utah. When I was in middle school they had some old Apple II computers — well, at the time they were rather new — and they say when you first fall in love with computers, your emotional growth is stunted at that point. So I was 11 and that’s my emotional age to this day because I just absolutely fell in love with computers. I’ve been tinkering and hacking the entire time since.</p><p>I took kind of a weird route through programming. I started in Apple Basic and then I moved to IBM and DOS and so I went into BasicA and GW-Basic and I moved up through the &#8216;Basics&#8217;, moved to Quick Basic &#8211; well QBasic &#8211; Visual Basic, then I sort of went down the rabbit hole. I went into C++ and then into C and then into Assembler.</p><p>At that point I was writing graphics drivers and writing video games and just really, really enjoying it and then somebody said, “You know, does it really have to hurt this much to be efficient? And do you really need to be that efficient?” So I said, “I don’t know, tell me more about what you mean.” He said, “Well, there’s this language called Perl and it’s this very high-level language, much higher than even Basic.” I absolutely fell in love with how much you could get done — yeah, you gave up a ton of efficiency, but for 90% of the things you do, you don’t need super efficiency.</p><p>Also, Perl is write only [as a language], it’s very terse and everything is implicit, they value implicitness, don’t waste time telling me things that I already know.</p><p>A few years later Python came along and I’m like, “Oh my gosh, it’s like Perl, only clear.”<br
/> Python has one right way to do it and every other way is wrong and that started to stick in my craw a little bit. Then I came across Ruby. Ruby’s attitude, of course, is there’s probably one right way to do this, but this general class of problem has nine different types of solutions. Unlike Perl where you should try to use all of them for every situation, Ruby says you should use the best one for each given situation. I think a lot of Python people would say that, too, so I don’t want to kick Python’s tires too much, it’s not a bad language.</p><p>But I finally found my way into Ruby and I’ve just absolutely loved it. It’s a language that lets me do what I want the way I want and communicate to others in the way that I like.</p><p>So that’s more of a programming language history of me. Does that answer the question?</p><p><strong>Thom:</strong> That’s perfect, because my next question was how did you discover Ruby? You just answered it for me.</p><p><strong>David:</strong> Perfect.</p><p><strong>Thom:</strong> This interview is remote control.</p><p><strong>David:</strong> Perfect.</p><h2>Neighbors &#8211; Friends &#8211; Fellow Rogues</h2><p><strong>Thom:</strong> So how did you discover the Ruby Rogues? Did I get an impression that you and Charles Max Wood were friends and had worked together?</p><p><strong>David:</strong> Honestly, &#8220;Location, Location, Location&#8221;, just like in real estate. I lived a mile and a half away from Chuck and I was actually at URUG, the Utah Ruby Users Group, back when there was only one Utah Ruby group [now there’s like five]. I was at URUG the first time Chuck came out to a Ruby meet. We made friends, we found out that we were living — did I say a mile away? More like 500 yards! I mean, literally, he was down my street, hang a left and go down a half a block.</p><p><strong>Thom:</strong> So like if you have a loud party, he’ll know it.</p><p><strong>David:</strong> Yes, exactly. Well, he moved, but it’s a small town, so now he’s two miles away and so we still know where to find each other.</p><p>Yeah, he got talking with James Edward Gray about starting up a panel-based podcast and just kind of out of the blue he’s like, “I think it would be funny to have you on the show,” and I said, “Okay, I will do my best to come and be funny.” I thought I had an opportunity as well to help people, not just be funny, but also to see things in a different way and that’s what I like doing, is getting into a conversation with people and then finding some angle that they haven’t viewed something from, and saying, “Well, have you looked at it this way?” Then there’s that moment when everybody around suddenly goes, “Oh, Wow!” and they make these mental connections that weren’t there before. That’s my favorite thing in the world to do ever.</p><p>I’d like to think that’s why Chuck invited me to be on the show, but the reality is, it’s probably just because I was in the room when he was thinking about it.</p><p><strong>Thom:</strong> I think you don’t give yourself enough credit, but that is funny, the self-deprecating humor seems to be common in the tech world.</p><p><strong>David:</strong> Yeah.</p><p><strong>Thom:</strong> Is there something that you’re working on or some project, is there a soapbox you want to get on?</p><p><strong>David:</strong> No, and I regret that. What I will say is that I have something in the works. I’m not ready to announce yet. I am getting into more of a training and mentoring aspect and so if anybody would like to do that, that’s the direction I’m going with what I’ve got in the works.  But that’s not the main business model, so it’s not even a “You can pay me to train you” thing, it’s just a “Hey, if you want to pair just get a hold of me.”</p><p><strong>Thom:</strong> Terrific. You know you’re going to get a lot of response from that. I may be at the top of that list.</p><p><strong>David:</strong> Absolutely! I think we could, maybe, break something together.</p><p><strong>David:</strong> One of the very first programming books I ever opened up said, “Don’t be afraid of the computer, you can’t hurt the computer by typing on it, unless you type with a hammer.” Yeah, I’ve burned up a disk drive by writing a program that was very disrespectful of the hardware timing. I don’t know how many things I’ve burned up or fried. They lied to me. They absolutely lied to me!</p><p>What is interesting; I actually never programmed in Fortran. I came in right behind it, but everybody that I looked up to and everybody that I mentored under had come out of Fortran. So for, oh gosh, 15 years, I was (in 1999) writing C++ code professionally as my career and I was rigidly formatting my code to 72 columns. I did not know why, and I got with an old-timer who saw that I was still doing that and he just died laughing. He’s said, “Do you know why you’re doing that?” I said, “No.” He said, “Because in Fortran you need to leave 8 characters for the address line on the punch card and you’ve only got 80 columns on the punch card, that’s why you’re doing that. You’ve got a 21-inch monitor,” (those were the biggest ones at the time) “stop formatting your code at 72 characters.” It’s like the old story of cutting off the pot roast because Grandma did it, but Grandma did it because it wouldn’t fit in her oven.</p><p><strong>Thom:</strong> Yes, it wouldn’t fit in the pan she had, right.</p><p><strong>David:</strong> Yes.</p><p><strong>Thom:</strong> So you probably also then &#8211; the habit I can’t break &#8211; put the constant first in a comparison?</p><p><strong>David:</strong> Actually, no, that came after my time. I came from Basic and then into C++, you can do</p><pre class="brush: cpp; title: ; notranslate">
if X = 42
</pre><p><em
id="__mceDel"> Right? And oops, you just assigned X the value 42.</em></p><p><strong>Thom:</strong> Exactly. Instead of comparing, you just assigned it.</p><p><strong>David:</strong> But I had gone through the phase where I was writing loops like <code>while *p++ = *d++</code> which is a de-reference copy and re-reference and then increment both pointers inside the <code>If</code> test.</p><p><strong>Thom:</strong> Right.</p><p><strong>David:</strong> And if you look at the source code for <code>strcpy</code> in the old C-reference, that kind of monkey business was not only allowed but almost praised.</p><p>So when Microsoft introduced the coding style of swapping the constant and the variable, it was just <strong>wrong</strong>. Constant == variable, it just never caught on and I still don’t do it to this day. I tried, I don’t like to throw away an idea without tasting it first and I spent a year where I rigidly did — I think they call LHC style, Left Hand Constant style — and no. It just read wrong to me.</p><p><strong>David:</strong> Ruby does the same thing because you can do</p><pre class="brush: ruby; title: ; notranslate">
if fp = file.open(...)
</pre><p>Then you’ve got an <code>fp</code> variable in the next line.</p><p><strong>Thom:</strong> When I work in VBScript, it just <em>(shudder)</em>&#8230;</p><p><strong>David:</strong> Just between you and me and — You know, I was going to say this is not for print, but you can go ahead and print this. I fed my family for a year writing VBA and VB script and so I don’t tell people that I do it, because if you want to hire me for that skill, I don’t want to work for you.</p><p><strong>Thom:</strong> I agree. In job interviews, when asked if I do VB or VB scripting, I always say, “Yes, but I wash my hands afterwards.”</p><p><strong>David:</strong> Yes. Yes, exactly. So anyway, I just wanted to mention that as a yes, it’s a mark of shame, but I stand with you in solidarity, brother.</p><h2>Revealing a new Perspective</h2><p><strong>Thom:</strong> What do you see your role in the Ruby Rogues?</p><p><strong>David:</strong> Obviously I have a pretty good sense of humor and I like to inject that where appropriate and then a little bit more, as much as I can get away with without annoying people too much.</p><p>Like I mentioned earlier, trying to make people think and see things from different ways is a very big goal. But the open secret that I have when I’m on the show is I love it when I’m on a show with two people that have wildly differing approaches to something. That one is like, “Don’t ever test,” and the other one is, “Over test everything.” When I can look at two people and say, “You know, you guys are in disagreement on 98% here, let me throw one-third thought in here that you guys haven’t mentioned,” and then both of them go, “Oh, my gosh, you’re right.” I absolutely love that.</p><p>I love the <strong><em>MINASWAN</em></strong> — that stands for <em>Matz Is Nice And So We Are Nice</em>. I really like honoring that in the community and when we have somebody on the show that has a really strong opinion about something, I love being able to temper that in such a way that we can have people with strong opinions that suddenly find themselves working together with their strong opinions, rather than opposing each other.</p><p>I think that’s kind of why my favorite episodes I’ve ever been on are the ones that have been on like diversity and drama in the Ruby community and interpersonal relationships. Those are my favorite episodes to be on because they’re such juicy topics for people to be wound up about and yet care deeply. When you can get two people and tap into their caring deeply, you can suddenly make them going from disagreeing violently to agreeing; maybe still violently.</p><p>But that’s really what my favorite thing to do on the show is. I just use the humor to distract from that.</p><p><strong>Thom:</strong> Thanks David</p><p><strong>David:</strong> My pleasure.</p><p>You can find David Brady in the usual places:</p><ul><li><a
href="https://github.com/dbrady">Github</a></li><li><a
href="http://rubyrogues.com">Ruby Rogues</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://rubysource.com/interviewing-rogues-david-brady/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <series:name><![CDATA[Interviewing Rogues]]></series:name> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 14/18 queries in 0.013 seconds using memcached
Object Caching 899/906 objects using memcached
Content Delivery Network via cdn.rubysource.com

Served from: rubysource.com @ 2013-06-20 04:39:36 -->