Coercion, Zero Equals 0 and Learning Javascript

02 Sep 2020

What do I think about Javascript?

The first programming languages I became familiar with were C and Python, which means that learning this language was not that different. However, there were some new things I had learned. First, I was always told that comparing a string to an integer will always return “false” no matter what. However, when I learned Javascript and its use of coercion, I had come across things like 0 == “0” that return true. Even if you compare two different variable types, Javascript will convert one of them to be the same. When you use “===”, it will check the variable type like Python and C. In some situations, I could take advantage of coercion so that I don’t need to write a code to convert a variable to another type.

From a software engineering perspective, I think Javascript is very weird about how it handles scopes. When you declare a function with a some undeclared variable in it, Javascript automatically assigns that variable as a global variable. So technically speaking, you could use that variable if you wrote some code before that function. This, paired with the use of coercion, can lead to confusion in the code if I made a mistake that was not related to that.

What do I think of athletic software engineering?

Athletic software engineering is a very good way of getting concepts into your head. Practicing new things constantly help me not forget the concepts that were taught that week. The practice WODs are very useful since they prepare us for more difficult WODs, and give us time to ask the professor about a concept we are not familiar with. This style of learning is very new to me, especially when we can’t have a classroom during the COVID-19 pandemic. This style of learning could be difficult if you don’t ask questions to your peers. I think this style of learning works for me, since it forces me to actually practice.