Random Thoughts on Thinking about JavaScript by a beginner

 Blog for JavaScript


           In Highschool and College, one of my favorite classes was symbolic logic. I loved the nature of breaking down arguments into their most basic components and the nested nature of 'ands' and `ors`. But one thing that always disappointed me in this subject was the inability to make it an art. Largely, these puzzles acted as Sudoku puzzles for the mind. Once they were complete, they were abandoned, and one would move on to the next one. I always wanted to do more with it, but breaking down philosophical works to their basics can only be so much fun. I wanted an art where art was not easily found. 


           This sheds light on one of the most interesting components of programming and my journey through JavaScript. The fascinating portion regarding programming is how many solutions can be developed to solve the same problem. For example, forEach and .map both perform largely the same function—they take an array and alter it via the instructions you give. However, forEach destroys and recreates while .map copies and then alters. In programming, you have the ability to approach a knotty problem with different tools. If forEach is like a hammer smashing down a rock to the exact specifications, .map is like an archaeologist carefully capturing every detail and recreating the object elsewhere so that a new copy can begin. Likewise, let is like writing in pencil, const is like writing in permanent marker. 


There is a point in all of this. Programming is often seen as an alphabet soup of strange vocabulary words brought together. Their meanings are sometimes clear; however, often they appear arcane, mysterious, and almost designed to keep the feign of heart away from its study. But beginning to see one’s text editor as a canvas and trying to see each method as a tool for a specific purpose, I believe, helps to keep one centered on what one is learning. Programming may appear rigid, but in many ways, it is more art than anything. The possibilities start to appear endless as one starts to obtain tools to code. 


This particularly came up during a project. I found a need to remove every element in a db.json. A task that seemed simple at first, but as I thought about it and attempted to see my options for the problem, I found it to be quite difficult. One cannot simply just target the results of the .json  and run a delete. This made me ponder watch was retrieved during a fetch: an object holding everything that I needed to make my cards. Each would be given a unique id by the .json and I wanted to smash every single one of them down. A simple forEach would run through the fetch and smash each target down as they were fetched. Fetch was like a grapple, and the forEach would be just the necessary tool to smash them. 


In short, I have found making odd visual connections to my coding experience to be endlessly helpful. Finding bugs in my code becomes more interesting as I read through each line explaining why I did what I did and how each piece is necessary to construct the algorithm or overall function I need.When a method for coding appears like something hard to grasp, I think it pays to keep in mind that it may have a purpose that can be easily broken down to a real life example. Visualizing the problem in silly examples may be just the enthusiasm or out-of-the-box thought that keeps you from going absolutely insane staring at lines. Or you may just find that you missed a bracket--then colored brackets and parenthesis are your friends. 

Comments