Thoughts from the office by Ed Ball
Thursday, August 21, 2003

Is there a really good reason that the try statement (in C++, C#, JavaScript, etc.) and its friends catch and finally require a brace-enclosed block? What's wrong with this?

try
DoSomething();
catch (x)
LogError(x);

I know that the grammar doesn't allow it; I just wonder why. I suppose I could scour the newsgroups for the answer. Maybe I should ask on the proposed comp.std.csharp newsgroup.

8/21/2003 1:32:13 PM (Pacific Daylight Time, UTC-07:00) | Comments [2] | Code#
Search
Archive
Links
Categories
Administration
Blogroll