Am I the only one that finds it annoying that try blocks mess up your scoping?
If I have some code like:
Person[] people = GetPersonList();
...
Then I realize that I need to wrap this in a try/catch block...
try
{
Person[] people = GetPersonList();
}
catch ()
...
But ah! no... now 'people' cannot be used outside of that try block. So I have to move the declaration above the try statement, set it to null, and just assign it inside the try block rather than declare it. Hassle.
So here's my second language suggestion of the week: Make try blocks the exception (no pun intended) for variable scoping. If I declare something in a try block, then it should not scope the variable, just the code.
This may mean you could have an uninitialized variable if an exception was caught - but that's ok, we just raise a warning that it hasn't been assigned to unless it's also set in the catch block. Most of the time we'll be aborting or something in the catch block anyway.