Why would Colossus want to drink water?
ajdiaz
Posts
-
Sept 26, 1983...the day the world almost ended -
Layers and exceptionsThis approach works best in scenarios where you are writing all layers of the application, because you are sharing error handling codes and classes all throughout you application. But if you want to build libraries independently of each other, like for commercial use, I personally believe, you are better off throwing exceptions. You can create your own Exception classes if you want, but still use exception handling.
-
Layers and exceptionsI hate programmers that swalllow exceptions in low-level layers (like database access libraries) just because they are afraid to throw it back up because it might crash their application. I have spent numerous hours debugging applications, just to later find out that another programmer coded the lower-level library to swallow the exception, because it was "safer". I insist that any low level layers like utilites and database layers must (1) catch the exception (2) log it in a file or notify via email and (3) throw it back up. Let the business layer handle it and decide whether to notify the client. And most times I will place the exception message somewhere at the end of the custom error message back to the client. This has saved me countless hours of debugging, because instead of getting an generic error message, I get the real problem, which might come 20 calls deep down from a lower-level library. And sometimes, you need to just throw the exception back up always. For instance, you have a webmethod in a webservice, that returns an array of strings or a custom object. This webmethod might call many other libraries, business objects, database objects, etc. If there is an error, you do not have much error handling to work with, you have to return the array of strings or the custom object. Therefore just throw the exception and let the consumer of the webmethod deal with it. We all know that exception handling is a very expensive transaction and should not be over-used or abused. But being afraid of exceptions because they crash your application is a much worse approach.
-
How many people here still develop apps in Win32 with C/C++?Only to write viruses and hacking tools. Win32 C++ is the best!
-
What corporate buzzwords do you hate? [modified]I hate ASAP. I also hate "I need it YESTERDAY". Neither one helps. And neither can be more uncertain from an accurate time estimate.