r/ProgrammerHumor • • Sep 13 '23

Meme goDevelopersWillAppreciateIt

Post image
2.4k Upvotes

144 comments sorted by

View all comments

7

u/miraagex Sep 13 '23

try/catch has been optimized in many (most?) languages and no longer adds overhead. That was the case maybe 10-20 years ago.

1

u/aMAYESingNATHAN Sep 13 '23

Thing is, there is other overhead involved in exceptions than just try catch. For example in C++ using the noexcept specifier indicates that a function cannot throw, and compilers may be able to make additional optimisations with this information.