Click here to Skip to main content

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: How not to catch the exception PinmemberGastonV20-Jun-13 5:30 
GeneralSomething is not as I expected PinprofessionalMohibur Rashid19-Jun-13 23:40 
GeneralRe: Something is not as I expected PinmemberAmitosh Swain20-Jun-13 18:53 
GeneralRe: Something is not as I expected PinprofessionalMohibur Rashid20-Jun-13 23:25 
GeneralRe: Something is not as I expected PinmemberAmitosh Swain20-Jun-13 23:32 
GeneralRe: Something is not as I expected PinmemberRob Grainger24-Jun-13 0:57 
GeneralRe: Something is not as I expected PinmemberMember 467320212-Jul-13 14:11 
GeneralEverywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed19-Jun-13 21:28 
Let me start this discussion something like this:
 
Obviously, we need to catch only specific exceptions and that too if it is required.
But unfortunately this is not the case in my company. Here for each and every method (regardless it is required or not) you will find a single catch catching only the top Exception. Error logging is being done here and then sometimes it is being rethrown.
 
I dont understand this scheme/practice and hence I discussed regarding it with my Developers, peers, and Manager(s) but most of them say something like these:
--> 'It does not make any difference'
--> 'We are doing in this same fashion everywhere from beginning'
--> 'My TL asked me to follow like this'
--> 'It is a client's requirement to log all top exceptions all times and it should not be missed anytime'
 
Is any point from above is applicable?
Let's have some discussion please so that I get a broad and clear picture.
 
Thanks.
Understand SOLID! Believe SOLID! Try SOLID! Do implement live SOLID; your Code base becomes Rock SOLID!!!
 
http://www.codeproject.com/Articles/593751/Code-Review-Checklist-and-Guidelines-for-Csharp-De

GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pinmembercjb11019-Jun-13 22:13 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed19-Jun-13 22:20 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinmemberRob Grainger24-Jun-13 1:02 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinmemberJarek Kruza19-Jun-13 22:56 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed19-Jun-13 23:08 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinmemberJarek Kruza20-Jun-13 2:30 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinmemberRob Grainger24-Jun-13 1:04 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed24-Jun-13 1:31 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinmemberChris Ross 224-Jun-13 3:32 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinmemberRob Grainger24-Jun-13 5:08 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalV.20-Jun-13 0:25 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed20-Jun-13 0:56 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. Pinmembercjb11020-Jun-13 1:12 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed20-Jun-13 1:26 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalV.20-Jun-13 1:31 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalMohammed Hameed20-Jun-13 2:11 
GeneralRe: Everywhere a single Catch block used catching top Exception all times. PinprofessionalRichard Deeming20-Jun-13 2:36 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 26 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid