Javascript and Rails pre - project debrief

Posted by George Ruiz on October 7, 2019

I’ve done it! I’ve completed the Javascript and Rails part of the curiculum. This section of the course was not only fun but challenging in many ways. Coming from a person who has never been in contact with JavasScript besides some research I had done online before enrolling in FlatIron, I’m going to just touch base on a few topics I thought were not only entertaining but informative.

  1. Manipulating the DOM
  • It’s all about exploration and learning.. Right? The course is informative, lengthy, and descriptive, but they can’t show is everything! That’s why it’s up to us to be our own teachers at times. In my opinion the Manipulating the DOM was the perfect way to give us a map on exactly how to do that.

    I actually remeber way back when I didn’t know a thing about developent. Sometimes I’d accidently hit inspect or F12 on my computer and I’d see what I thought was something out of the Matrix. Not knowing exactly what it was. I actually thought it was kind’ve interesting. I remeber being able to research it and would see quirky ways on how to manipulate it with articles titled how to put your screen in dark mode etc..

Now with some HTML and CSS knowledge it was time to actually learn how to manipulate it. This was the first code to a path that lead me to the start of my very own JS project.

let element = document.querySelector("p#greeting");
let lement.innerHTML = 'Hello, DOM!'

Incorporating methods and variables like these would become a building block to everything throughout the rest of this section and well JS program. Most importantly functions!

  1. Functions in JavaScript

function helloWorld() { return 'Hello World!' }

`let helloWorld = function() { 
 return `Hello World!' 
 }` 
 
helloWorld = () => {   return "Hello World!"; }   ` 

All three do the same thing and the course did a great job on show casing them all. However, Arrow functions to me rain superior. Not only cleaner but make it easier for a user to read.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” ~ Martin Fowler

This quote throughout my coding journey will be something I will follow (most of the time). However, one thing i’d like to point out is that really going into arrow functions came in very late to the section. It was touched on early on. But didn’t really get any deeper explanation until the end of advance function usage which was over half way through the learning. This is what lead me to do a lot of the labs with my function helloWorld() { return 'Hello World!'} example when possibly arrow functions could’ve helped me complete the labs quicker.

Conclusion -

With this all being said I believe these early lessons really did make the section enjoyable and easier to navigate. Learning all these very imporatant JS fundamentals early on made it easier. I’m excited now to start my JS and Rails API project and am hopeful that not only the easy things like above, but the more complex and complicated things we have learned will be implemented.