As the third Kiev Ruby-conference RubyC-2015 approaches (30-31 May 2015), organizers present an interview with Erik Michaels-Ober, Rubyist from Germany, who became a RubyHero in 2014. Erik is a popular mentor among different Ruby-communities: Ruby Summer of Code, Google Summer of Code and Rails Girls Summer of Code. At the RubyC-2015 he will present a topic “Crystal programming language”, details can be found on RubyC. Learn more about Erik from his answers below.
I started working on Ruby full-time in 2006, when my team decided to port our web application from PHP to Rails. Rails had just turned 1.0. I believe we were using Ruby version 1.8.4 with Mongrel as the web server. This was before Rack, Bundler, RubyGems.org, or GitHub. In retrospect, it’s hard to imagine working on Ruby without these tools that I now use on a daily basis.
Ruby made me realize the value of people over computers. Most programming languages are optimized to make executing code fast. Ruby is optimized to make reading and writing code fast. This changed the way I thought about code: from something that I write for the computer to something that I write for other people.
Ruby, the language, is great but my true love is the Ruby community. By joining this community, I’m now connected to nice people, all around the world. I love meeting new Rubyists at meetups and conferences. I’ve learned so much from others, who openly share their knowledge on their blogs, podcasts, screencasts, etc. I love Rails Girls, RailsBridge, and other community programs to make programming more diverse and inclusive. I also love the creative spirit of the Ruby community, inspiring projects like Artoo, Kids Ruby, Shoes, Gosu, Sonic Pi, etc.
If talking about the most terrible architectural solution/code I have ever met, the first thing that comes to mind is the way Rails performs uniqueness validation. For those who don’t know, it just does just does a SELECT to see whether the field already exists before doing an INSERT. The first problem is that these two operations are not done in a transaction, so there’s a race condition that allows non-unique values to be inserted. However, transactions are not a good solution either, since they would cause too much table locking. The best solution is simply to create a UNIQUE INDEX on that field in the database, which guarantees correctness and optimal performance. The Rails approach to uniqueness validation is an impedance mismatch that gives the user a false sense of security.
The most spectacular Ruby news in 2014 was the creation of RubyBench.org by Alan Guo Xiang Tan. It is an incredibly valuable (and long-overdue) contribution to the Ruby community. This project will ensure that there are no performance regressions in Ruby so it only gets faster with each release. If RubyBench existed in the past, it could have prevented the performance regression in require that snuck into Ruby 1.9.
Life after Ruby is Crystal! See my talk for more information. ;)
Currently I am working on rewriting the Twitter CLI in Crystal and coaching a Rails Girls Summer of Code team.
My dev environment contains the Fish shell, which I recommend to anyone who spends a lot of time on the command line. Try it for a week and you’ll never go back!
I recommend the book, Ruby Under a Microscope by Pat Shaughnessy, because it is a fascinating look at how Ruby works under the hood. I would also recommend Practical Object-Oriented Design in Ruby by Sandi Metz to any Rubyist who hasn’t read it yet. For a better theoretical understanding of computer science, I recommend Understanding Computation by Tom Stuart. To absolute beginners, I recommend Learn to Program by Chris Pine. Finally, Why's (Poignant) Guide to Ruby has a special place in my heart.
My personal life hack is: add the following line to your crontab: */30 9-17 * * 1-5 say "Stand up and walk around"