Rails Magic

By far the most frustrating part of learning Ruby on Rails was the confusion of dealing with “Rails Magic”. I remember telling someone, “I love Ruby, but I hate Rails. There’s no logic to the things it does.”

It’s a lot like looking at a solution to a complex math problem solved by a mathematician who doesn’t bother writing out the steps she can do in her head.

An experienced mathematician will appreciate not having to write out or read those basic steps, but if someone were to try to learn math by following that example, she would be hopelessly lost.

There are a ton of things in Rails that are helpful shortcuts for experienced Rails developers, but are tremendously confusing for newbies.

For example, there is a seemingly endless number of ways to tell Rails:

If the URL is ‘www.example.com/photos/new’, you should show the template located in the file ‘photos/new.html.erb’

Amongst those endless options, the ones that are most commonly used are the ones that give you the least information about what they are doing behind the scenes.

This is true not just for routes, but for pretty much every part of Rails. It’s chock full of short-cuts and assumptions, and if you don’t know what those short-cuts and assumptions are, it can be quite difficult to understand.

For that reason, I have decided to write a series that will connect the dots between the explicit or long way of doing things and the more commonly-used shortcuts.

Coming up: Part 1: Creating an App

Advertisements

3 thoughts on “Rails Magic

    • I looked at the issue, but it’s very difficult to diagnose without having seen the code before and after.

      It does look like you did a great job hacking away at the problem until you fixed it. I know it’s frustrating not to know why something works or doesn’t. I find that the “aha” moment often comes much later after working on an unrelated problem and learning something new about the way Rails works.

      I’ve heard it said that the ability to deal with frustration and confusion is one of the core skills of a developer. Just keep hacking!

      On a side note, I would like to slap the people who voted down your question. There’s nothing wrong with your StackOverflow question, and I hate to see experienced devs discouraging new devs from asking questions.

      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s