Programming Java in Eclipse, I’m used to having to deal with exceptions. In C# with VisualStudio it seems I can not say “throws exception” on a method… After a lot of coding I found lots of exceptions, and had to catch them as I found them during testing. I’d like to be forced to handling them, so that VisualStudio can say that here you need a catch or I’m not going to let you go on 🙂 Is this possible?
Thanks
No. C# doesn’t force you to handle exceptions. This was a concious design decision on the part of the language designers.
For details on why, see The Trouble With Checked Exceptions, where Anders Hejlsberg discusses why they aren’t part of C#.