Skip to content

Comment on JS performance: try / catch versus checking for undefined parent

Comments

The C++ philosophy has always been that exceptions are for truly exceptional situations, not a tool for regular flow control. Consequently, practically all C++ implementations optimize heavily for the non-exceptional case - try/catch blocks are almost free as long as nothing gets thrown.

AboutSource Built by g1lg1l

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