Ylan Segal

The REPL: Issue 6 - January 2015

The REPL is a monthly feature in which I pick my favorite content from around the web, read, but not necessarily published, in the last month. Most of it is technology related.

Suspicions of nil

In her usual eloquent and clear way, Sandi Metz explores the issue with passing nil around as a return value from other objects. She shows a few of the pitfalls and type checking necessary to deal with the complexity. I’m looking forward to the promised sequel, billed to explore the Null Object pattern.

Command-line tools can be 235x faster than your Hadoop cluster

Adam Drake explores traditional Unix tools to analyze a large data set. Using cat, find, xargs and awk he shows that performance can be much better than that used by a Hadoop cluster. The comparison is based on results from another post, which I could not find, since the link seems to have gone away. Nonetheless, I think the the point is made abundantly: Before jumping on the latest shinny big-data thing, it’s probably a good idea to try the tools already installed in your server.

Myron Marston’s Response To Tenderlove

Tenderlove posted a review with his experience with MiniTest and RSpec. Myron responded to some of the issues addressed. I found both articles good reads. I have used both frameworks extensively and I am personally partial to RSpec. However, I applaud Tenderlove and Myron for their posts and the decorum which they exhibited. It is quite common for online back and forth to descend into personal insults quite fast. This is not the case. In the course of the discussion, I also learned a thing or to about both frameworks.

Pairing with Junior Developers

Sara Mei writes an excellent piece about how senior developers can make the most out of pairing with junior ones, with better results for both developers. I personally don’t pair at work all the time, but I found that most of the content is applicable not only to pairing, but working with junior developers in general. As with most things, you get more out of it if you are dedicated and mindful.

Stagnation

Dependency management in Ruby, is almost universally done with Bundler. It provides an easy way to declare other Ruby dependencies in your application and install them on demand. It manages the explicit dependencies you tell it about in your Gemfile and also resolves the transitive dependencies, those that you do not specify directly, but are declared by the dependencies themselves.

Bundler generates a Gemfile.lock that locks those dependencies to specific versions to ensure that your application is tested and deployed to production with a known environment. The procedure solves a number of problems, one of them being insulating your application from change.

That code that you write depends on a stack of other software to operate correctly, to fulfill the function it was designed for. Bundler recognizes that in the future, new versions of the components of the stack will be release and introduce breaking changes. They will no longer work with your application in the same manner they do now.

The REPL: Issue 5 - December 2014

Seven Reasons I Love Minitest

I am partial to RSpec, but this is a well-reasoned argument for using Minitest.

Hashie Considered Harmful - An Ode to Hash and OpenStruct

Great post on using Hashes, OpenStruct, value objects and Hashie and the performance implications. Schneems is clearly opinionated and find fault with a very popular library. In his style, though he actually does something about it. He has a pull-request to change the underlying implementation and started a discussion with the library mantainers.

Speeding Up PostgreSQL With Partial Indexes

The title says it all. Well written and explained. Definetly a worthy tool to have availbale when optimizing performance.

Book Review: Effective Ruby - Peter J. Jones

Peter J. Jones, the creator of Vagrant, brings us “Effective Ruby : 48 Specific Ways To Write Better Ruby”. A book geared towards ruby programmers that are already familiar with the structure and syntax, but are looking to get more out of the language. The books covers a wide range of topics, with surprising amount of depth. The chapters are divided into small ‘items’ that can be consumed individually and stand (mostly) on their own. Each offers practical tidbits that can be applied to your own code immediately. I read the book cover-to-cover, but I it would also be suited to jumping around from item to item.

I found the chapter on Classes, Objects and Modules to be very useful in understanding how Ruby treats inheritance and method dispatching and the implications of which the reader should be aware of. Also of note, the chapter on meta-programming sheds some light on very useful techniques to avoid shooting yourself in the foot, a pretty common occurrence when meta-programming in Ruby.

I have been programming Ruby for years and I enjoyed reading the book a great deal. I learned some new tricks and re-acquainted myself with some forgotten ones as well.

Links:

The REPL: Issue 4 - November 2014

Lagom is not Just for Swedes

Great article on DHH’s RailsConf 2014 keynote. Even though you can have a badly designed system with tests, let’s not throw out the baby with the bath water.

Collaboration is Other People

Jon Yurek writes a thoughful opinion about the use of style-guides. It’s not about the pendantry of the use of curly braces or spaces, but about working as a team, better communications and focus on the important things in the code.

36% smaller Rails memory footprint through Benchmarking

Great tale about finding a great win by running benchmarks, the power of open-source collaboration. One small pull request will benefit thousands of rails apps in the future :)

In defense of fat tools

The Unix philosophy is to build small things and connect them together. How small? That is the crux of the matter. In this post, Avdi shows why sometimes using slightly larger tools, correctly abstracted away can yield better results than roll-your-own simpler alternatives.