MVC - Oh Baby

Posted by jaybednar on April 7, 2018

First, I want to say how much I am thoroughly enjoying my path through the Flatiron curriculum. I can’t believe its been over 2 months since I started the program!

I started into the Sinatra section this week, and, actually I am almost done with it. Kinda like a good book you can’t put down, you know? Anyway, in the Sinatra section, is your first true intro to the MVC structure (although its been mentioned a bunch throughout). The reason why I wanted to write this blog post on MVC is that this week I have been feeling the same excitement as I did the very first week of the program. And again, I have been enjoying everything, but I will admit the SQL/ORM sections were slightly dry for me while I was working through them. And its funny, because I actually do like the database work, but I think it was more about the lack of instant gratification and visual feedback. (ie. while learning Ruby, you start writing methods, then can immediately see them work. Even with HTML/CSS, you see the ‘websites’ come to life in your browser) . But HTML isn’t extremely mentally stimulating, as there is no logic involved.

Another thing for me working through the sections preceding Sinatra, is that you don’t quite have the whole picture. It’s somewhat hard to see how you will actually utilize everything to make a full application. (Maybe it was just me lol) But I also felt like I was sooooo far away from actually being able to build anything meaningful.

Enter Sinatra and MVC. This may sound weird to others, and honestly it was weird for me, but the main reason for my extra excitement this week, was that it felt like within a snap of two fingers, the full application format was revealed to me. (Cue the lights shining down from heaven and the orchestral serenade - lol). Obviously, I have soooo much to learn still, but I see it now. I see how it all fits together, on a basic level at least. Regardless it just feels good to have those “aha” moments.

My wife and I talk alot about how differently our brains work. She thinks very freely and can move from subject to subject without skipping a beat, usually losing me in the process. See I focus in on a topic, and before I move on to the next topic, I have to properly reference it ( kinda like being in a sub-directory and telling the program to look in a different directory ‘../app/views/index.erb’). And its been said that men think in ‘boxes’ in their brain, I seem to take this to the extreme. Anyway, that long-winded explanation of thought process was only to say that another reason I was so excited with MVC this week, was how extremely satisfying I found the file structure. Having an ‘app’ directory, that contained, a ‘models’, ‘controllers’, and ‘views’ directory, each with their corresponding sub-directory and files, each with their own set of responsibilities, made me feel like a kid in a candy store. (If you haven’t figured it out already, I’m a little strange)

So with this renewed vigor and utter enjoyment for how the app fits together so perfectly, I carry on, anxious to get my Sinatra project mode on, and then move on to Rails!