Sign in
Log inSign up
Calvin Torra

115 likes

1.3K reads

6 comments

Catalin Pit
Catalin Pit
Jun 16, 2021

Interesting. I never looked at them in this way.

I learnt something new today!

1
1 reply
Calvin Torra
Calvin Torra
Author
Jun 16, 2021

You and me both 馃槃 Thanks for stopping by

1
Ivan Montik
Ivan Montik
Jun 16, 2021

Interesting

Niranjan Borawake
Niranjan Borawake
Jun 16, 2021

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 ? .

Pankaj Patel
Pankaj Patel
Jun 18, 2021

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"

Andrew Baisden
Andrew Baisden
Jun 24, 2021

Hmm thats an interesting way to look at it thanks for sharing your thoughts Calvin T