Home > Articles > Programming > Ruby

An Interview with Michael Hartl: Ruby on Rails, the "Magic" Problem, and the Higgs Boson

Russ Olsen talks to Michael Hartl, author of Ruby on Rails Tutorial, 2nd edition, about teaching Rails, keeping pace with an ever changing technology stack and the Higgs boson (really!).
Like this article? We recommend

Russ Olsen: Michael, let me start by saying how happy I am to get this chance to talk to you. I've been a big fan of the first edition of the Ruby on Rails Tutorial for some time. Not only have I used it to help programmers new to Rails come up to speed, I'm happy to say that I've profited from going through it myself.

Michael Hartl: I've enjoyed Design Patterns in Ruby, so the feeling is mutual. :-)

Russ: One thing that surprised me as I was preparing for this interview is that you have a Ph.D. in theoretical physics. How did you start in physics and end up in Ruby?

Michael: My work was mainly in computational physics, so I was writing programs all the time as part of my Ph.D. research. I also got interested in the idea of starting a company when I graduated. It was obvious in the late '90s that software was moving online, so I decided to learn web development. I started with PHP, moved on to Python (in the pre-Django days), and then found Rails.

Russ: The 2nd edition of the Ruby on Rails Tutorial is due out in August. What's new with this latest version?

Michael: The new edition uses Ruby 1.9 and Rails 3.2. This includes the new asset pipeline and a rewrite of the authentication system using has_secure_password. The sample application's site design has also been completely re-done using Twitter's Bootstrap framework.

Russ: One of the best parts of the Ruby on Rails Tutorial is the combination of the video lessons with the book. How do you decide what goes in the videos versus what goes into the book?

Michael: My process is simple. I put the book's PDF on my iPad and then read along while developing the sample application. This invariably leads to commentary and digressions that wouldn't be natural in the context of a book but make sense as part of a hypothetical conversation with the watcher of the video. I also make a point of keeping some of my mistakes (instead of editing them all out), both to teach debugging techniques and to reassure the watcher that nobody's perfect (especially me).

Russ: I'd also like to ask you about what I've come to think of as the Rails 'magic' problem: The good news about Rails is that it takes care of so many of the mundane details of building an application. The bad news -- at least if you are trying to learn or teach Rails -- is that to the newcomer, all that help seems indistinguishable from magic. How do you cope with this in the Ruby on Rails Tutorial?

Michael: I'm not convinced that "magic" is a problem. Rails includes a domain-specific language for making web applications, which shields you from the underlying implementation. I think this is a feature, not a bug. After all, Ruby is written in C, but you don't need to understand C to use Ruby. I consider that a good thing, even if it does seem a little magical at times.

Russ: One of the fears that I have heard voiced with increasing frequency lately is that as Rails has grown more mature and capable, it is also slowly drifting away from its original concept as a simple, easy to use framework. What do you think?

Michael: Rails was always designed to be a "full-stack" framework, and I think that's a major virtue. My hypothesis is that almost all websites, even ones that are originally only static content, eventually become full-blown web applications. This means you should always start with a full-stack web framework. For example, the official Rails Tutorial site is a Rails app, despite being almost all static content, and this has saved me enormous headaches over the past couple of years. (This includes custom redirects, caching, and the occasional signup form.)

One role the Rails Tutorial can play in this context is to offer those new to Rails a path to basic competence without having to face the complexity of the full framework. Once they have a good foundation, they can proceed to the many intermediate and advanced Rails resources to improve their expertise.

Russ: Another good news/bad news aspect of Rails is just how fast it is moving. How do you manage to keep yourself and the tutorial up to date?

Michael: I pay attention to changes that might affect the tutorial, mainly by subscribing to Riding Rails, the main Rails blog. Rails has matured significantly in the last few years, and most new changes make little difference to beginning Rails developers.

Russ: Along the same lines, do you have a favorite recent change or new feature in Rails? A least favorite?

Michael: The introduction of has_secure_password made writing custom authentication systems much easier. In fact, it led to the elimination of an entire chapter of the Rails Tutorial, so the second edition actually has one fewer chapter. (It's slightly longer, though, due to material new in the second edition.) I can't think of any changes I really dislike, and I hope Rails 4 keeps it that way.

Russ: I've always advocated that people learn some Ruby before they dive into Rails. In the Ruby on Rails Tutorial you take a hybrid approach -- teach a little Rails, then a little Ruby. Why did you go that way?

Michael: Many people come to the subject with a great enthusiasm for writing web applications, and I don't want to dampen their enthusiasm by telling them that they first need to read a 500+ page book on Ruby. I can go either way on this one, though, and it really depends on each particular reader.

Russ: No conversation about programming would be complete without touching on a few religious questions. So here goes: Emacs or vi or something else? Haml or ERB? Are you a CoffeeScript kind of guy or do you like your JavaScript straight?

Michael: I've used both Emacs and Vi(m) extensively, and they don't fit my brain. I loved NEdit on Linux, and enjoyed TextMate on OS X, but Sublime Text 2 is my current editor of choice. It's fast, full-featured, and friendly. Haml and ERB have different strengths, and the latter is the more prudent choice when you're just starting out. As far as the JavaScript wars go, I'm neutral—I haven't touched that stuff for ages. Given the way the world is moving, that may change soon, so feel free to ask me again in a year or two.

Russ: So what do you do when you are not working on the Ruby on Rails Tutorial?

Michael: I like to take time off when I'm not writing or screen casting. Last year, after the first edition was done, I took several trips, including one that evolved into a global circumnavigation. This time my leisure is less ambitious, but I am planning a trip to New York, and I'm reading a lot of old books.

Russ: What's next for you?

Michael: I have a four-step plan for world domination. The Rails Tutorial is Step 1. Next up: Step 2. Further updates as events warrant. :-)

Russ: One last question. Higgs boson: myth or reality?

Michael: It's real, all right, and finding it was an impressive piece of detective work. Now all we need is to find a Bigfoot and a Loch Ness Monster and our sleuthing will be complete.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020