First Thoughts on Javascript

19 Jan 2022

Programming Experience

Being a computer science student, I am getting pretty used to learning new programming languages every semester. When I was first getting into programming and computer science, I thought Java and Javascript were the same thing (which I now know is not the case). This class is not the very first time I have worked with Javascript, I have a few weeks of experience with it from high school. So far the programming languages I have worked with are Scratch, Python, Javascript, and HTML/CSS in high school and Java, C, and C++ in college. Back in high school I didn’t really get into Javascript libraries because it was only being taught as an introduction to program theory. I don’t really remember much from my time working with Javascript in high school, but I have a pretty good idea of what to make a program do to solve a problem. As long as I refresh my memory on the syntax of whatever language I am working with I can learn them again more quickly than the first time kind of like muscle memory.

Starting Javascript

This class was the first time I even looked at Javascript for about 3 years, so it felt a little new again and I actually learned a good amount from the FreeCodeCamp lessons. I usually would have just breezed through them because they were mostly easy problems that took less than a minute each, but for many of them, I took a few extra minutes to try and get used to syntax differences from Javascript to C and C++ that we used in ICS 212 (my most recent computer science class). There were a few things that were basically the same like while/for loops, if statements, and logical/arithmetic operators to name a few. There were many things that were different, for example: functions, not having declared variable types, and back ticks for quotes and inserting variables. Comparing what little I know of Javascript now to what I learned of C and C++ last semester, I think Javascript looks easier to read, allows for arrays with multiple data types, and prototype inheritance makes classes simpler than many other languages.

First WODs

For the first two practice WODs “E07: Project Euler Problem 1” and “E08: isUnique” I thought out a solution in my head within a few minutes, but I had to look up how to write them out in Javascript. I was able to create the structure of the function required for E07 in about a minute, but on my first attempt, it took me a while on my first attempt because I tried using a while loop and got the wrong answer so I had to go back and fix it with a for loop which ended up taking almost 7 minutes which was not DNF (8 min) according to the time rubric, but I wanted to get my time to at least the Av (4-6 min) and even more the Rx (<4 min). The second time I went through it I went straight for a for loop and I ended up finishing it in a little under 3 minutes which I was happy about. On the second practice WOD isUnique, I had the idea to check each letter of the string against the rest of the letters in the string. I wasn’t sure if it was going to go smoothly at first, but I attempted it and quickly found out that my double for loop that went through the string twice without skipping the character to be compared. I took a chance and found out that the second parameter of a for loop can take logical operators like && so that I could skip the index of the letter I was comparing to the rest of the string. It took me a little under 3 minutes and the Rx time was <4 minutes so I got a little lucky and finished early.

Athletic Software Engineering

This class is the first time I’ve ever heard of “Athletic” software engineering. I’ve been playing sports since I was a little kid and I’m pretty familiar with “normal” athletics. I’ve played soccer, baseball, football, basketball, and lifted weights in my 15 years or so of athletics. I like being active and basketball in particular because I can directly see the results of my effort, and I’ve learned that sometimes failing and being uncomfortable is the best way to learn. Obviously no one likes to lose or be unable to do something that they think they should be able to, but this could also be seen as the best motivation to learn for next time. Putting pressure on students to complete a task in a limited amount of time is understandably uncomfortable, but most people would try to do anything in their power to be able to finish the next WOD in the given time. I don’t like failing, but I have learned that just reading something because someone told me to is not always the most effective way for me to remember things. If I fail to complete an assignment or solve a problem, I usually don’t forget it which shows that failure can be a good thing. Athletic Software Engineering can also translate to real life jobs where you are under pressure with deadlines and you can get in trouble for not finishing your work on time. I believe Athletic Software Engineering will help me learn in this class more than precious computer science classes and I look forward to trying more of it.