How Ruby Met Rails
Yukihiro Matsumoto invented the Ruby programming language in 1995. Matsumoto, better known to the programming community as "Matz," he had the idea for Ruby back in 1993 as a language that would "make programmers happy."
Matz's vision was for a "genuine object-oriented, easy-to-use scripting language." But he also wanted the language he made to be fun and enjoyable to program in. The programmer, and his or her humanity, was every bit as important as Ruby's more technical features. Matz has said:
"Often people, especially computer engineers, focus on the machines. They think, ‘By doing this, the machine will run fast.' [...] But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves."
Ruby's syntax is flexible, but ambiguity is rare. The language is dynamically typed. Once the code was open-sourced it started to collect some playful quirks, on top of its original elegance. The Ruby string class, for instance, knows that if you refer to "octopi" you're invoking the plural of "octopus." Another example: you can refer to the second item in an array both as "ArrayName", and as "ArrayName.second."
By 2000, Ruby programmers were starting to gain steam as a quirky, friendly community of developers who patched in even more playful idiosyncrasies. But then something happened, which made quirky little Ruby one of the most-used programming languages in the world, and changed the face of the web, and web development, forever.
How David Met Jason
Enter David Heinemeier Hansson. In 2001, the 22-year-old Danish engineer started contracting with a Chicago-based web design firm called 37signals. Initially, his arrangement with the company was very, very informal:
"I was working from Copenhagen, Denmark making $15 an hour that was actually being paid out in Apple hardware at the time because getting money back and forth was a little bit of a challenge. [So they] would just send me like an iPod or like a Mac book [...] something like that."
37signals wasn't just any web design firm. Its founder, Jason Fried was a bit of a thought leader in the world of software. His blog, Signal vs. Noise, had a dedicated readership of designers and developers, and later became 37signal's company blog.
Fried approached web design with more philosophical zeal than the average designer. In 1999, he had launched 37signals not as a company, but as a manifesto. The manifesto had 37 points, many of which railed against things he saw as wrong with the software world. The title was a reference to the 37 unidentifiable signals the SETI program had picked up in 1988.
Among the points made in the manifesto were:
"The Web should empower, not frustrate."
"[C]orporations don't use web sites, people do. B2whatever, we'll design a site that works for the person on the other end."
"You don't need a pen that's also a parachute, you need a website that works for the people who use it."
As Fried has since noted, "In 1999 everyone else was elbowing for the loudest, brightest, most colorful, techiest ‘full service end-to-end' site. We went the opposite direction."
Jason Fried (Ed Schipul)
This philosophy attracted a following. It also appeared to be a very successful approach to web design. Armed with "clean, fast, usable designs," a tiny crack team, and pseudo-celebrity status, 37signals did very well.
After a few years of coordinating four in-house employees with contractors like Hansson, Fried felt the need for a project management tool: to keep track of all the different parts of a project, and whose hands they were in, and to communicate all of this to clients. According to Fried:
"We tried some off-the-shelf and open source blog tools, but they just weren't right for what we had in mind. We looked at some of the other tools out there, but they all seemed to be built for bigger "small" companies. We're four people--and passionate about usability and simplicity--and we didn't find anything that really spoke to us. Nothing excited us. Everything was more, more, more instead of less, less, less."
Eventually, they decided to build something themselves. And Fried asked David Heinemeier Hansson -- who was still in Denmark, but whose work had impressed Fried over the years -- to be the lead engineer. Hansson was excited to work on the project, but he wanted to develop in the still relatively obscure scripting language called Ruby. Quote Fried:
"I had some natural hesitation about using Ruby at first ("What the #@!* is Ruby?" "Why don't we just use PHP--it served us well before?"), but [David], cogently made the case and I bought it."
"I'm a designer and a business guy, not a developer," Fried has said, explaining the decision. "I'm not going to push PHP or Java or whatever just because I've heard of it. If you don't trust your developer to choose the right environment, then how can you trust him to build the best application? Trust is critical here."
Investing In What You Know and What You Need
It turns out that Fried made the right call trusting Hansson. The project management tool became Basecamp, now the company's flagship product (they've even renamed themselves after it). And in the decade to come large parts of the web would be rewritten, and new parts built, with Ruby.
Ruby's human-centered approach fit right into 37signals' design philosophy. But Fried's status as a non-developer might have protected him from some slightly scary details about Hansson's plan -- mainly that Ruby was not yet a web development language, and had a long way to come.
Websites would still be made of HTML and CSS, so in order for Ruby to make sense as an efficient tool for web development, Ruby code had to fit into a framework to coordinate with these things. And Hansson and 37signals devised an elegant one. They adopted a "model-view-controller" architectural pattern to keep the different functions of a website, and the files in languages suited to these functions, separate. They also integrated technology like AJAX into their system, which made designing websites with complicated back-ends much easier, and made them easier to scale.
Hansson built features into the framework as he needed them, and as they worked for the Basecamp team. In 2004, 37signals extracted this framework and published it as open source. Thus, Ruby on Rails was born.
"When we built Basecamp we didn't know we were building Rails at the same time," Fried has said, "but that's exactly how it happened. [...] Basecamp was the divine chicken, Rails was the egg."
The Rise of Rails
Job Listings for Ruby developers from indeed.com
The rest is history. Starting in about 2006, the demand for Ruby developers skyrocketed. But even at the beginning of this trend, the combined success and impact of Basecamp and Ruby on Rails had made Fried and Hansson "demigods." Hansson in particular was dubbed, "The Hottest Hacker on Earth," by WIRED magazine, and recognized as "Hacker of the Year" by O'Reilly and Google. From an article in WIRED:
"As Hansson took the stage at the British Columbia Institute of Technology for this, the first Ruby on Rails conference, the room was filled with the kind of giddy excitement that greets the opening chords of a Hannah Montana concert."
Like Linus Torvalds to Linux, Guido Van Rossum to Python, Hansson is to Ruby on Rails. And Ruby itself became one of the essential languages of the web -- Rails had propelled Ruby from fringe obscurity to ubiquity. Twitter, AirBnb, SoundCloud, GroupOn, Hulu and GitHub were all built in Ruby on Rails.
But whether Ruby was ever the only language that could have built these apps is up for grabs. The language's technical features are important, Hansson says, but not actually what make Ruby his language of choice.
As he told the crowd at RubyConf 2010, the idea of there being a "best tool" for the job, "has the pretext of being objective." And, for Hansson, it's not about objectivity. It's about pleasure.
"Ruby fits my brain like a glove [...] There's something about the aesthetic of how Ruby lays out on the screen that is intensely joyful."