As someone new to JS, a friend of mine insists that I always use classes and inheritance, and that functional style / composition is bad. However, most of the newer libraries I read through all seem pretty functional, whereas the older ones are full of classes. Personally, I find myself writing everything with factory functions and composition because it feels natural to the way I think about code. Am I wrong, and sh…
I've been getting paid to write JS/TS for about 10 years. I think I've used the `class` keyword less than 5 times in the last 5 years and feel better off without it. I've found that a more functional style leads to better separation of state/data from any logic you have to write, allowing for a better testing experience and an easier time refactoring. Plus it means I have to think way less about what `this` means. At…
It's fine to want to go functionally heavy, but if you're not using classes - which are the foundation of 'types' - then why bother with 'type'script? (Unless you mean to say 'interface'? Which is obviously not 'class' but implies the same usage of OO-founded keywords)