JavaScript: Style with Substance

31 Aug 2022

JavaScript in modern times is often looked down upon as an older and more outdated language. Oftentimes, people recommend newer languages which provide more features and interesting ideas. However, in the same way C is still used despite many alternatives being created, JavaScript stays relevant by mixing style with substance to create a solid language with more flexibility than older languages while also having the simplicity to be easily started without the need for any outside resources.

Java vs JavaScript

Personally, I started with Java as my first language. I’d always hear from professors about how “Java is a very verbose language”; However, I never really understood the meaning of those words until I started to pick up JavaScript. Actions like assignment are easier in JavaScript because you don’t need to declare the type every time you make a variable. This makes it easier to code quickly since you don’t need to think about the type of the variable for every variable you make. This also applies to arrays where an array can hold any type of value instead of a single value. One of the most surprising things I learned about the language is the fact that you can return different types from functions. Whereas in Java you might need to clumsily design another function, in JavaScript you can have two different return types making functions far more flexible when used in practice. All of this in addition to ES6 allows for some really creative coding that is both shorter and more readable while still accomplishing the task needed.

Athletic Software Engineering

Compared to Java, I much prefer JavaScript when it comes to writing code; however, a lot of this might come down to the way in which I learned JavaScript. The athletic software engineering philosophy that we are using in my current class leads to a more streamlined approach to learning coding when compared to the standard methodology. The athletic software engineering philosophy emphasizes speed of coding through timed “Workout(s) of the Day” (WODs) while also building problem solving skills. The timed WODs are stressful, especially since they are graded on a pass or fail basis and offer harder coding questions. However, these dilemmas lead to a better understanding of both the language and course material. On traditional assignments, you can spend as long as you want trying to debug your code or looking up syntax. Combined with weekly homework deadlines, this leads to finishing the assignment in one day and not programming for another week. WODs space out the programming into short focused bursts more indicative to effective learning. I think that this approach is better for me as it forces me to consistently contend with difficult problems in a limited amount of time.