Conquered the JS Rails struggle (for now)

Posted by Bryce Whittington on October 9, 2020

Tough, but doable

This Mod 4 project, a Single Page Application built with HTML, CSS, and JavaScript that communicates with a Ruby on Rails backend API, has been a tough one for me (as has writing out that drawn out sentence.) To start, I still feel a lot like I’m at the beginning of the learning JavaScript hill. I’ve completed all the lessons, attended all the lectures, and now finished the project, yet I still feel like I know so little JS. That’s okay, I felt that way for a long time while learning Ruby (still do to an extent) and I know it’ll come with more and more practice.

Debugging

One (of the several) topics I spent a lot of time trying to figure out for this project was ironically: debugging. The keyword debugger acts similarly for JavaScript like binding.pry does for Ruby in that you can almost pause your code in time to see values and where things might be getting caught up. Knowing this (and the use of console.log() for backup), I’d say a lot of the time I spent stuck with this project was trying to get an understanding of what error messages in the Console were trying to tell me. Thankfully, JavaScript is an older language and enough people have gone before me to have covered a lot of the ideas that kept my project from working as planned. All part of the fun!

Slow and Steady

I remember at the end of my Rails project for Mod 3, I wrote in my blog that I was excited to learn JS (still am!) and that I wanted to learn more CSS since my first couple projects worked fine but didn’t have a lot to offer visually. I can honestly say I made good progress with CSS- slow, and still a ways to go, but good progress. Part of that is that classes are already required to do some of the DOM manipulation that was needed, so it forced me to spend more time than I would have normally, but the other part is still a genuine interest in wanting to make web pages look nice since so much work went into the rest of the design and structure.

Googling

I’ve heard from people in this field that so much of learning to code is learning to Google. That’s how this project was for me. I’m normally a 5-6 open Chrome tabs at a time kind of guy, but I counted 24 open tabs across 3 different browser windows at one point during this project. I had searched for everything from reverting to an old repository on GitHub, to error codes that were traced back to me trying to run a server from within the wrong directory- and that doesn’t even include any code questions!

Glimmer of Hope

As with all the projects, once I’m at the point where my project has met the requirements and it’s doing (most of) the things I hoped it would do, I feel 100 times better about my understanding of the topic than I did before the project. I’m still doing regular supplemental studying to try to absorb as much as possible, but things are trending in the right direction with React coming up shortly.