115 likes
路
1.2K reads
6 comments
Interesting. I never looked at them in this way.
I learnt something new today!
You and me both 馃槃 Thanks for stopping by
Interesting
Nice summarisation. Thank you.
Yes, classes are harmful but the culprit is this
:D. The best way to avoid this
is to not use new
and thus classes. Take the functional root. No more call
, apply
and bind
.
In fact I had put up a test for the ones who think they understood this
- Do you really know this
? .
I agree with you that JS has everything we need just with Prototypal Inheritance
Though, personally, I still see some value in writing Classes in JS
The idea of Factory functions was around really long time and still we went ahead and got the Classes in JS.
And even with classes, I really like the Factory pattern and usee it whenever needed.
In the past, Whole lot of discussion was around quirks and logical/lexical execution of JS and it made the Software from JS prone to lot of errors; originated from general understanding of language (myself included)
With Classes, I see that gap between other OO languages and JS is very small and probably that's why people wanna try JS for their next application.
I don't create Classes in my regular project work but I see some value there; even if it is syntactical sugar; as we commonly phrase, "write software for humans"
Hmm thats an interesting way to look at it thanks for sharing your thoughts Calvin T