Why C does not exhibit the Exception Handling?
Exception Handling
Collapse
X
-
Tags: None
-
Exception handling is one of the major Disadvantges of C programming language. C doesn't provide direct support to errors or exceptional handling. Since it is system programming language it does provide low level errors handling in the form of return values.
C will return -1 or NULL, in the case of errors. -
I don't think it is accurate to say C doesn't provide Exception Handling. <signal.h> and <setjmp.h> could conceivably be used for exception handling. What you mean is C doesn't provide the kind of Exception Handling that you want.
The answers to "Why does C do this?" and "Why doesn't C do that?" are usually the same:- C was developed in 1972. C has been tremendously successful. There is great reluctance to introduce new features that might break existing code.
- C has traditionally been a what-you-see-is-what-you-get language with a lean runtime library. There is reluctance to introduce new features that require complicated unseen behavior in the runtime library.
Comment
Comment