Thinking of the useful things
It's been ages since I've posted to this blog. Since I wrote last, Arsenal have won the FA Cup, Liverpool won the Champions League, Port Power has been totally written off as a chance for any kind of glory in the AFL, and this morning there's news that Ashley Cole (of Arsenal) has been charged £100,000 for his involvement in the 'tapping-up' affair.
Anyway... yesterday I went to a user-group meeting and heard Dave Glover (a Microsoft guy) talk about security in Visual Studio 2005. He showed us a feature whereby you could hit a button and it would look through your code to find out what security permissions it needed to run successfully.
I put up my hand and asked if there was a way that you could find out what things in the code caused the 'requires XYZ' flag to be set. He said he didn't know, looked up, and said he didn't think it was available. There was a general consensus in the room that it would be really good if it would do that. And it got me thinking... It's all well and good for something to be able to produce a list of what security permissions a piece of code needs, but if you get surprised by the results, surely you want to be told why a particular flag got set.
What if a compiler only told you that a particular program failed to compile, rather than what made it fail? Pretty quickly, people would complain about that compiler. I guess it's a bit like trying to open an XML version of a spreadsheet, and simply being told that it failed on the 'Table' component. Or trying to check a file into NetIQ Application Manager that doesn't compile. I feel like it happens all the time. Even RunTime errors in the .Net Framework don't tend to give particularly useful error messages... you really need to catch hold of every different type of exception and bubble them up to the top, or else catch none of them, so that you can see what is causing the particular error.
If anyone ever catches me putting together some code that fails but doesn't say why, then please call me on it. I want to produce code that tells the user's what went wrong with what they were trying.