Skip to content

Comment on Stop Using Constructors in JS (2012)parent

Comments

It's not async functions, it's first class functions. Having multiple ways of calling a function doesn't compose. I have enough experience to know where the foot guns are at, but I don't like writing code that has foot guns in them. It's like `null` in Java. "Remember to check for null before using every object". "Remember to use new before every function that instantiates an object.". I'd rather programmers quit creating new classes of errors in languages for 'programmer convenience'.

Object creation has not yet caused my any performance issues, so I've not seen a reason to personally use `new`.

AboutSource Built by g1lg1l

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