The Rails Tutorial Chapter 2: A toy app
“Don’t worry if it’s confusing for now; we’ll discuss these ideas more thoroughly…” I’m not sure how many times some version of this sentence came up in this chapter, but the importance of reassuring the student that it’s ok not to understand everything at this point cannot be overstated. This ties back in to Hartl’s genius in providing a high-level view of Rails and then diving deeper into each section incrementally so as not to overwhelm. The sophistication of this toy app was a moon landing-sized leap over the hello world app in Chapter 1, but it didn’t once feel overwhelming or frustrating. In fact, the only frustration I experienced was when I failed to follow the instructions exactly for creating a remote repo and then had to spend 30 minutes figuring out how to change the remote origin. I’m certain I didn’t find the most efficient method and eventually just deleted (rm -r) the whole directory and started from scratch. It’s amazing how one little mistake can have catastrophic effects, further emphasizing the importance of utilizing Git.
Chapter 2: A toy app teaches us how fast and easy it is to develop with Rails. I created a very basic version of Twitter with very little effort. Hartl takes care to emphasize that while scaffolding is good for getting started quickly, it is bad for understanding Rails as a whole. That’s something I can certainly agree with. In my previous training, I learned to use scaffolding, then was told it wasn’t the best method due to bloat, but I never gained an understanding of what the best method actually is. In the other courses I’ve taken, the strategy seemed to be to just give an overview of several different topics, but where they were greatly lacking was tying them all together. While I was struggling to understand what I was learning, I certainly never had a clue what I would be learning next. Contrast that with Hartl’s method of laying out the strengths and weaknesses of what we just built, making the declaration that “the rest of this tutorial is dedicated to building on the strengths and eliminating the weaknesses.”
- High-level overview of Rails
- Introduction to MVC
- First taste of the REST architecture
- Beginning data modeling
- A live, database-backed web application in production
- No custom layout or styling
- No static pages (such as “Home” or “About”)
- No user passwords
- No user images
- No logging in
- No security
- No automatic user/micropost association
- No notion of “following” or “followed”
- No micropost feed
- No meaningful tests
- No real understanding
Again, he even ends this list acknowledging that we’ve developed no real understanding of Rails at this point. This concept of getting comfortable with being confused and not understanding what you’re working on is one of the greatest skills a developer can hone. Even experienced developers learning a new language or framework will experience this feeling, but instead of getting frustrated, they keep pushing on with the confidence that they will understand it eventually.
Reinforcing another critical habit, I end this chapter by pushing to my remote repo and deploying the app live on the web. While I’d previously been exposed to Git and Heroku, nothing is solidifying my understanding of these tools more than using them every day. As this habit is so vital to successful development, it’s great to integrate it into my daily practice from the beginning as opposed to learning about them down the road in a different module. As I stated in my last post, there’s something so empowering about building and deploying on the web, regardless of the simplicity of the app. Assuming my wife doesn’t go into labor today, tomorrow I’ll be taking on Chapter 3: Mostly static pages, and I truly could not be more excited about what I’ll be building.