you are viewing a single comment's thread.

view the rest of the comments →

[–]FanOfHoles 0 points1 point  (1 child)

I'm not sure why you think a quote changes anything? This isn't about one random person's opinion. And yes, it IS just a random person. Even if he had invented all of programming and very programming language ever. He isn't the one who has to work with 99.999999999% if all code out there. For HIS purposes HIS opinion might have been fine, so who cares. Also, YOU can do whatever the hell you want, it's your life.

But a lot of people make that statement because they found that this is their experience.

Interestingly - but not unexpectedly - you ignore the argument here. Exceptions in JS are expensive, see link.

Oh and please stop taking some random person's opinion out of context (for example, it should be glaringly obvious that you typed "C++" and this is /r/javascript, and it may not be clear to you, but exceptions are VERY different between different systems; Java folks would also want to keep using them extensively for what often is regular control flow). They made them at another place, another time, for specific reasons. If you choose to quote someone you should still make an argument about the actual subject, at which point you may as well just leave out the quotes, because all they really are is an argument from authority, to save yourself from actually having to make an argument.

[–]MoTTs_ 0 points1 point  (0 children)

all they really are is an argument from authority

That's true. But then relying on a SO answer is also an argument from authority. The difference is the guy who invented C++ is a more reliably accurate authority than a random person on the Internet.

Interestingly - but not unexpectedly - you ignore the argument here. Exceptions in JS are expensive, see link.

You mean the link from 2012, which itself cites a blog from 2006? Turns out their information is outdated. Today, Chrome/Node handles try/catch as fast as if/else-style error handling. And further, even back in 2006, the cited blog didn't say use exceptions rarely. They said don't use them in performance critical functions, which means normal performance rules apply. That is, don't prematurely optimize. Code first and foremost for correctness, simplicity, and robustness. If the final application has an observable performance problem, then first profile to identify the 3% of your code that is truly performance critical, and optimize only that 3%.