Skip to content

Comment on Stop Using Constructors in JS (2012)parent

Comments

It's dogmatic not idiomatic.

That's not accurate; there are actual, technical reasons for avoiding new hence why some advise against using it.

There are equally valid technical reasons for using `new`, so it's dogma

There are equally valid technical reasons for using `new`, so it's dogma

I really don't want to get into this argument but that's not what dogma means. Dogma is something that comes from an authority as being undeniable but saying you can't or shouldn't use new isn't undeniable, it's deniable as you said yourself there are valid reasons for using new.

and now I hate myself. Thanks.

damn, I've been using that word slightly incorrectly for years, and now I hate myself. Thanks.

Whoa a pleasant exchange on the internet. Yay.

What are the technical reasons to avoid using new?

AboutSource Built by g1lg1l

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