For the last two weeks, our cohort has been learning about Sinatra and embedded Ruby (erb). Although, sometimes I feel like a lot of information is going in one ear and out the other, I can definitely see my progress at this point. The MVC (Model View Controller) framework has really started to become solidified as well as it’s interaction with the database. If we didn’t set up the right relationship with our database to begin with, everything would really be fked. Everything is pretty well falling into place, and that feels good.
I am going to write about the Model View Controller (MVC) pattern. This pattern is key to getting everything to function properly on a web page and I think it’s fascinating! Not only is it really interesting, it’s absolutely key to the whole user experience. If your Models are not communicating well with your Controllers, the Views will be broken. And the cycle just continues.
Starting this project was a major struggle for me. Conceptually, I understood how files interacted with one another, but it wasn’t until I put it into practice that it really clicked how during the initialization process, you give your class characteristics and only then can it go out into the big bad world of code to show off what it’s made of. If you as the programmer, don’t give your class the ability to have a name, it just won’t have one. That is both a comforting and an anxiety inducing thought. Ha!
I am going to tackle the absolutely age old and pressing question of when to the use .each method versus using .map. When I first started learning Ruby, wayyy back in June of this year (though, it has felt like a lifetime ago), I was using .each on everything. Oh, you want to iterate over an array? A hash? Perfect, .each is the catch-all.