Week 5 entry for my coding bootcamp diary:
Much to my chagrin, it turns out “The Dom” has nothing to do with "The Fast and the Furious" after all (“I live my life a quarter of a line of code at a time”). No, the DOM is the Document Object Model, “a programming interface for web documents that allows the document, style and content to be changed”. I understood the overall concept. I understood very basic exercises related to the DOM. But anything beyond the basics was difficult. We ended the day with all of us trying to make a functioning calculator. I probably contributed about 5% of the code. Not feeling great, but trusting the process. At the beginning of all of this, my instructor said that learning how to code isn’t like a light switch. It’s not like walking into a room with the lights off, you flip a switch, the light comes on and suddenly you understand programming. He described it as being more like a fog that slowly dissipates. Little by little, piece by piece, programming becomes clearer. While I may not have The Dom down 100%, the fog is slowly lifting.
Thankfully, we were able to get more practice with the DOM. Our instructor drilled into our heads you select, modify (or add info), and then append to the container that you selected in step one. Every exercise today focused around these steps. Much of the exercises were a blur and I required a lot of extra work on my own time to solidify the concepts. However, by the end of the weekend, I was able to complete a To Do List that had eluded me earlier in the week.
One way you can modify your HTML from the DOM is by using innerHTML. However, this should be avoided for several reasons, the biggest one being the potential security risk it creates for your code. In addition, innerHTML reparses the entire tag and event listeners can be inadvertently removed as well.
One of my classmates had shared some cool VS Code shortcuts for writing code. Which got me curious what other kind of shortcuts were out there. I found this great Emmet cheat sheet. You can find it here:
In honor of the Red Hot Chili Peppers reuniting with John Frusciante and the release of their upcoming 12th album, I listened to these two a lot this week:
What do you consider to be the all-time greatest RHCP album?????