Click here to Skip to main content
16,006,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Registry API hooking! Pin
Kannan Kalyanaraman16-Dec-02 20:18
Kannan Kalyanaraman16-Dec-02 20:18 
QuestionAre exceptions bad? Pin
clintsinger16-Dec-02 12:18
clintsinger16-Dec-02 12:18 
AnswerRe: Are exceptions bad? Pin
Taka Muraoka16-Dec-02 12:52
Taka Muraoka16-Dec-02 12:52 
GeneralRe: Are exceptions bad? Pin
Tim Smith16-Dec-02 13:15
Tim Smith16-Dec-02 13:15 
GeneralRe: Are exceptions bad? Pin
Nemanja Trifunovic16-Dec-02 17:26
Nemanja Trifunovic16-Dec-02 17:26 
AnswerRe: Are exceptions bad? Pin
Tim Smith16-Dec-02 13:20
Tim Smith16-Dec-02 13:20 
AnswerRe: Are exceptions bad? Pin
Matt Gullett16-Dec-02 17:06
Matt Gullett16-Dec-02 17:06 
AnswerRe: Are exceptions bad? Pin
Alvaro Mendez16-Dec-02 17:09
Alvaro Mendez16-Dec-02 17:09 
Exceptions are a great way to write clean and maintainable code. Their benefits far outweigh any extra-overhead concerns you may have. You can just read lines of code without being distracted by the all the possible error conditions that can come from every method call. Then if you're really interested in seeing how errors are handled, you go to one or two places in the code that catch the exceptions, instead of all over the place.

A great argument for using exceptions that comes to mind is the new languages such as Java and the .NET ones. They all make extensive use of exceptions in their libraries. It's interesting to note that in C++, exceptions have more overhead because the compiler has to deal with calling destructors for all the locally defined objects, in addition to unwinding the stack. Still, it's probably not a lot less innefficient than the code the compiler executes when a regular block is closed.

Of course, it should be noted how to properly use exceptions. They should be thrown only in the case of errors that cause the flow of the code to be interrupted, and should be caught only in places that can properly deal with them.

Regards,
Alvaro



Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
AnswerRe: Are exceptions bad? Pin
Nemanja Trifunovic16-Dec-02 17:30
Nemanja Trifunovic16-Dec-02 17:30 
AnswerRe: Are exceptions bad? Pin
nde_plume16-Dec-02 17:33
nde_plume16-Dec-02 17:33 
AnswerRe: Are exceptions bad? Pin
Christian Graus16-Dec-02 20:49
protectorChristian Graus16-Dec-02 20:49 
GeneralRe: Are exceptions bad? Pin
Joe Woodbury17-Dec-02 12:17
professionalJoe Woodbury17-Dec-02 12:17 
GeneralRe: Are exceptions bad? Pin
Christian Graus17-Dec-02 12:29
protectorChristian Graus17-Dec-02 12:29 
GeneralRe: Are exceptions bad? Pin
Joe Woodbury17-Dec-02 12:46
professionalJoe Woodbury17-Dec-02 12:46 
GeneralRe: Are exceptions bad? Pin
Christian Graus17-Dec-02 12:59
protectorChristian Graus17-Dec-02 12:59 
GeneralRe: Are exceptions bad? Pin
Joe Woodbury17-Dec-02 16:45
professionalJoe Woodbury17-Dec-02 16:45 
GeneralRe: Are exceptions bad? Pin
Christian Graus18-Dec-02 18:00
protectorChristian Graus18-Dec-02 18:00 
GeneralRe: Are exceptions bad? Pin
Joe Woodbury19-Dec-02 5:17
professionalJoe Woodbury19-Dec-02 5:17 
GeneralFlicker free "glass" window Pin
HAB16-Dec-02 11:46
HAB16-Dec-02 11:46 
GeneralRe: Flicker free "glass" window Pin
Shog916-Dec-02 11:59
sitebuilderShog916-Dec-02 11:59 
GeneralRe: Flicker free "glass" window Pin
HAB16-Dec-02 12:17
HAB16-Dec-02 12:17 
GeneralShow/Hide Buttons in Visual C++ Pin
Neal McGough16-Dec-02 11:33
Neal McGough16-Dec-02 11:33 
GeneralRe: Show/Hide Buttons in Visual C++ Pin
Alvaro Mendez16-Dec-02 11:47
Alvaro Mendez16-Dec-02 11:47 
GeneralRe: Show/Hide Buttons in Visual C++ Pin
Neal McGough16-Dec-02 15:01
Neal McGough16-Dec-02 15:01 
QuestionCVS questions: what files to commit? Pin
Code4Food16-Dec-02 10:43
Code4Food16-Dec-02 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.