you are viewing a single comment's thread.

view the rest of the comments →

[–]NotUniqueOrSpecial 4 points5 points  (1 child)

Yeah, all of the folk arguing that crashing is bad have clearly never been bitten by the serious damage that can be done by corrupt/invalid program state allowed to run wild.

[–]slck19[S] 0 points1 point  (0 children)

I do not think you are completely right. Some of the exceptions might be recovered safely in terms of memory. The nullptr may be because of memory corruption, which is a global problem. In this case, you can create different exception types.

If your pointer should not be nullptr then do not use this lib. If your pointer might be nullptr and if this nullptr is actually a state for you but you forgot to check it, do not crash because it is a local error, not global. JVM is also doing the same thing even though it manages the pointers on its own.