Why doesn't C# have checked exceptions?

Published 12 March 04 12:23 AM

Checked exceptions are a very hotly debated topic in some circles, particularly for experienced Java developers moving to, or additionally learning, C#. Here are some resources that discuss the issue in depth:

Note that without the CLR itself supporting checked exceptions, it would be effectively impossible for C# to do so alone.

[Author: Jon Skeet]

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Zinoblog said on March 12, 2004 10:44 AM:
# Panos Theofanopoulos said on March 12, 2004 1:09 PM:
AFAIK is the Java compiler that enforces checked exceptions and not JVM. You can emit byte code that will totally ignore any checked exception.

So (in theory), the C# compiler could behave exactly as Java (using some special attributes)

but IMHO leaving checked exceptions out of C# and CLR was an excellent choice.
# C# Frequently Asked Questions said on June 1, 2004 3:39 AM:
# Cyrus' Blather said on August 13, 2004 4:20 AM:
# Confluence: codesmell said on June 8, 2008 5:24 PM:

From an Email conversation this evening: what do you think about it? For a while, I was "all flame" about Checked exceptions, but then I read about their limitations (which are why they aren't included in C#, more about it there :

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

This Blog

Syndication

Page view tracker