Hacker News new | ask | show | jobs
by thealphanerd 5098 days ago
I've been working on following the good parts for my latest project. I've started to cringe any time people talk about the prototype or using "this"
2 comments

That's unfortunate. Properly using prototypes and "this" is the only way to do high-performance JavaScript with objects.

Get cozy with them -- they're useful.

It isn't the only way, it's just that browser JS engines tend to be optimised for them.
I believe your statement is therefore equivalent to the preceding one.
I cringe when people claim to be writing more than the most basic JS and aren't using prototypes.
It's a style choice. You don't have to use classes and/or do anything with the prototype chain.
> It's a style choice

No. max line lengths is a style choice. indenting with spaces vs tabs is a style choice brace position is a style choice

Using prototypes and instances in JS is about using the right tool for the job.