Week 16: JavaScript Learning

Continued to learn JavaScript fundamentals through https://learnxinyminutes.com/javascript/ and comparing with Python. Got a bit lost in the source and couldn't really understand well the later parts of the tutorial. I started talking about constructors and prototypes, which I don't really understand. It's ok I will move on and learn about them later if the're important.

I also started learning from https://javascript.info/. This is such a great source. I will spend probably a couple of months to go through this. In some sense I think I should continue with project work. But I do see the benefit of some structured learning. The project work really showed my gaps in understanding, which makes it more motivating to do structured learning. Essentially, I think a combination of both is important. When I was doing project work, I was reaching a point where I didn't understand what I was doing.

A cool thing I learnt about is transpiling. Which is converting one high-level language to another or different version. JavaScript uses transpiling for backward compatibility. This makes sense since JavaScript is meant to be backwards compatible and run on all browsers. This really conflicts with Python, where you can use separate versions no problem. I can see why the design decision was made for JavaScript and how it has some legacy elements like var, unlike Python which has no legacy elements. I was also frustrated by the difference between JavaScript browser and node versions, but I can see the point of it now. The browser verison is limited in features such as file system, camera, etc. This is to make it more secure for the user. Also tabs generally don't have knowledge of each other, which is called same origin policy.

Will continue next week.

Learnings

  • Transpiling is converting one high-level language to another or different version
  • JavaScript uses transpiling for backward compatibility
  • JavaScript lack of filesystem functionality is by design
  • Hardcoded Consts should be in UPPER