Re:How JavaScript works: 3 types of polymorphism
by coyotespike on Sunday May 09, 2021 @10:24PM
(#27102048)
Yes, your friend is wrong. Like langager, I've been getting paid to write JS/TS for some years now (okay not 10!). Maybe because I started off in Clojure/Script, I still tend toward a functional style - and even React these days is very functional.
I certainly am not opposed to using classes. If the problem begs to be thought of as a noun, then I will reach for a class to represent it. Especially if we have a collection of nouns, which are related.
But in general I prefer to code in verbs, piping data through a series of functions and then mapping over them at last to produce components, for instance.
I certainly am not opposed to using classes. If the problem begs to be thought of as a noun, then I will reach for a class to represent it. Especially if we have a collection of nouns, which are related.
But in general I prefer to code in verbs, piping data through a series of functions and then mapping over them at last to produce components, for instance.