Skip to main content

Your biggest aha! moment?

Tips • Asked by Exequiel R.

Basically, what has been your biggest code aha! moment. That time when you understood some concept or mantra that you were familiar with but couldn't wrap your head around.

For me, being the noob I'm, I think it was the "keep your controllers RESTful" concept.

I heard about the concept before but never truly understood it until I got how would one go around the "design" of such controllers thinking about the RESTful actions performed over models.

In case some of you don't know, the basic premise is trying to have only REST actions in your controllers: show, index, new, create, edit, update, destroy, delete.

This post makes it pretty clear:
http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/

Even though it's a pretty basic concept, I think it's really powerful and sometimes ignored.

What about you? Do you have any aha! moments you can remember of?


I've had so many of these over the years, they were clear moments when I could tell I leveled up.

I think one of the big ones for me was realizing that Rails, Django, and all the other frameworks are simply text parsers. They parse HTTP requests, organize the request for you in regular old Ruby code and then you get to choose what to do based on that. It's so unbelievably simple, but yet hard to wrap your head around as you start. That was big for me.


That's really interesting Chris, I don't know if I came to the same realization but I do constantly remember while coding or doing stuff that seems complicated that it's just data passing around.

We love to create terms, buzzwords, new solutions to old problems but at the end of the day it's just data so if we think about it that way the journey gets easier.


Exactly. And that's why I tend not to talk in buzzwords as best I can on GoRails. Most of what we do is really not that complicated, it just appears that way because we try to name every little detail. If you can get rid of all that, you can start really understanding things. And once you do, that's where the names come from, as succinct descriptions of things you commonly see. The trouble is trying to learn the names first without having seen the underlying patterns repeatedly in their raw, unnamed format.


I would recommend this book:

https://rebuilding-rails.com/

It explains in a simple way how the different parts of rails (ORM, routing, auto-require, rendering, etc.) work under the hood and on the top of that It's way easier to understand than rails source code.


@Szilard Magyar thanks for the recommendation. I just bought the book and started reading it.
I had already seen it but I finally took the decision to buy it,

It seems pretty interesting and even thought I kinda get how Rails work I'm sure I'm going to learn tons of stuff from it.

Thanks again!


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.