Eloquent JS & OO Refresher

Published on Tuesday, 1 June, 2021

Happy post memorial day!

I'm still learning...are you?

I just finished chapter 6 of Eloquent Javascript by Majin Haverbeke. Really cool chapter, and likely the densest yet. The chapter covered objects in considerable detail, diving into prototypes and how each object derives properties from the original object, Object.prototye. Additionally, I learned a good amount about classes in JS, and how you can use keywords such as set, get, static, etc. as shorthand for getters & setters & static methods. Also, how Classes are really just a sham! A wolf in syntactic sugar! No but seriously they are esentially a wrapper for prototype assignments and object creation. Pretty neat.

The chapter also covers some key OO principles such as iterators, inheritance, encapsulation, and interfaces. How to write them, how to work with them, why they are important, etc. I will say I did not know that inheritance was a sort of controversial topic in OO programming. This is because it actually ties objects together in a way, rather than keep them modular. The whole purpose of Object Oriented programming is to keep data divided so that it is much simpler to work with. It allows for very complex and independent systems that do not rely or impact one another. But unfortunately, code can easily become spaghetti code when you start sharing exact memory locations or properties. Great read so far, check it out!

Thanks for listening!