Skip to content

Comment on Svelte 5 release candidate (RC)

Comments

I agree with Rich's take that classes are mostly bad when you do things like inheritance.

However, I don't really know why he thinks classes are awesome without inheritance, either. Once you do away with inheritance, what's the benefit over writing a function that builds an object? Get rid of the middle man, the extra keywords, the prototype chain, etc., and go with a function. Did I miss something?

Where does Rich mention classes are mostly bad when using inheritance?

I don’t disagree, but I never got to hear/read his thoughts on that subject.

And yeah - I like the idea of defending any use of classes instead of reaching for them to brush your teeth. Some places (my current place) will reach for classes all the time without even the excuse of bundling state.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.