What's the reason in your mind Exception are heavily used in Managed (C# and Java) language but not in C++?
Posted
by
ZijingWu
on Programmers
See other posts from Programmers
or by ZijingWu
Published on 2013-11-05T04:57:18Z
Indexed on
2013/11/05
10:11 UTC
Read the original article
Hit count: 157
AFAIK, a lot of C++
projects don't allow exceptions and deny them in coding guidelines. I have a lot of reasons, for example, Exception
is hard to handle correctly if your binary needs to be compiled by separate and different compilers.
But it doesn't fully convince me, there is a lot of projects which are just using one compiler. Compared to C++, Exceptions
are heavily used in C#
and Java
and the reason can only be that Exception
are not bringing enough benefit.
One point is Debugbility
in practice. Exception can not get the call stack in C++ code, but in C#
and Java
you can get the call stack from Exception
, it is significant and makes debugging easier. No-CallStack is not the fault of the Exception
, it is the language difference , but it impacts the Exception
usage.
So what's the reason that exceptions are frowned upon in c++ programs?
© Programmers or respective owner