View Single Post
 
Old 05-21-2017, 07:11 AM
SiriusProjects SiriusProjects is offline
Regular
 
Join Date: May 2006
Posts: 90
Default Error Handling - VB6 To .Net

Hi All,

I come from a background where I did extensive programming using VB6. I have now move to .Net and have to say I am really enjoying the programming experience with VB.net.

One question I do have and to be honest I used to ask this same question a lot when I was using VB6. Where and when do you use error handling?

When I started programming using VB6, the temptation was to error handle ever procedure, method and event. But as I became more experienced I started to reduce the amount of error handling and only placed it where there was a high likelihood of an error being generated.

I have continued to use 'On Error Goto" coding in my initial programming attempts in VB.net, but have now discovered the "Try, Catch" method and want to move over to this. But the same question is on my mind. Do you wrap every procedure, method and event inside a "Try, Catch" or do you only use it where there is a high probability of an exception being called?

I want to improve my coding and ensure that I adhere to best practise in all areas of .Net programming, so I would be grateful for any advice you may have.

Thanks.
Reply With Quote