November 2008 - Posts
November is the month of flowers…

Straw flowers in the rockery: very bright !! (is it just me or does that photo look kind of surreal//photo-shopped ? It isn’t, it’s straight form the camera, but those young flowers look like someone has pasted them there <g>)
Around the straw flowers some ground covers are growing nicely. I like these daisies:

The scarlet callistemons (aka Bottle Bushes) are in flower:

As too are the lemon callistemons:

And the luecadendrons add that lovely flower/foliage contrast:

luecadendrons up closer :

a different kind of leucadendron:

and a broader view of it:

And of course there’s the king proteas:


and lots of other proteas:

Over by the veggie patch this climber I planted last year flowered this year. It died back a lot over winter but seems to be taking off again well:

Even the veggies are getting into the flower power thing…..
celery in flower:

And carrots :

And even the first of the tomatoes:

But of course a veggie patch needs to have vegetables….
Potatoes :

There’s actually snow peas growing between those potatoes. And that’s beetroot flowers on the right, and on the left the remnants of some broad beans that are currently being harvested.
And more broad beans grown from my own seed:

Bush beans, which got eaten by slugs badly:

When I introduced the straw mulches this year I disrupted the balance in the garden badly, and slugs thrived and attacked a lot of the young seedlings. This was compounded with some dodgy seeds which had very poor germination. And because the straw brought in lots of parrots (seed not slug eaters), I suspended old msdn CD’s above the garden as bird deterrents. They worked well, but the slugs thrived more than any frogs or lizards could keep up with. I removed the CD’s, moved the mulch off the beds putting it in the furrows, and went on a couple of night excursions with a torch squishing slugs. Seems to be back in balance now :)
The weather has been dry. Not really hot, only had one day or so in the 30’s (90’s on that quaint old american scale), but dry. It’s been record low rainfall again the last month or two, and after years of drought a lot of the country is at risk of not only severe fire but also loss of ecosystems. Here it isn’t too bad, but then again this is one of the wettest parts of the state. Either way it’s certainly not weather you’d call “nicer weather for ducks” , although this duck by my dam seems rather oblivious to it all ;)

you can tell from the title there’s a Friday rant coming can’t you ? Well yeh, sometimes what should be a simple task of writing code becomes painstakingly slow. Take for example this one line of code:
Dim doc = XDocument.Load("abc.xml")
Now if you like to write robust code, somewhere in your mind there should be that voice saying, “ah but what if the file is not there or can’t be opened or isn’t valid xml “…etc, etc. So the first thing you probably think of doing is look at what exceptions the method can throw, or so you’d hope.
Problem 1. VB doesn’t display the exception information from any xml documentation. Our first failure to communicate that then leads us on a great chase.
Problem 2. Who ever wrote the XDocument.Load method actually failed to provide the exception documentation. The Load method calls external methods such as XMLReader.Create and the exceptions from that are unchecked, allowed to bubble through. The documentation should indicate an include statement to say the XMLReader.Create exceptions bubble up. The author(s) of XDocument.Load failed to communicate the exceptions that could be thrown.
Problem 3. If you like to keep current and have installed the SilverLight 2.0 SDK, F1 help will take you to a SilverLight topic even if you are writing a Console application. That little voice in your head that first said “what if …” is now screaming. There’s a failure to communicate between Visual Studio and MSDN help.
Problem 4. Your only resolve is to do the lookup in msdn help yourself, only to find the documentation has no exception information because it relies on the xml documentation (see Problem 2). The failure to communicate cascades.
Problem 5. As a last ditch desperate measure you use Reflector and walk through the code. Thankfully in this case the code is reasonably simple. The problem now is how do you get that information back into your code, so as you handle the correct exceptions ? This isn’t Relector’s fault as such, as the same problem exists if you do find the exception information in Visual Studio’s object browser. This is a failure to interact, but it can result in you not handling exceptions or documenting which exceptions bubble up from your methods, causing your code to fail to communicate. (see Problem 2.)
If religious wars were still in fashion, we’d be saying “hey what about checked exceptions al la Java ?”. The more I am frustrated at how hard it is to write robust code because of these often cascading failures to communicate, the more I want to sign up with the holly sect for checked exceptions.
An alternative is to provide rich tooling and analysis. Some years ago, myself and Geoff Appleby with some help from Mark Miller wrote a plug-in for refactor that did a look up based on the code you selected. It would match the method calls with their xml documentation, refine and sort the list based on inheritance rules (most specific first), and let you choose which ones to add to your code. It really was simple once you got the method info, which is where refactor (or more accurately DXCore) came in. Unfortunately we hosted that project on the now defunct GotDotNet site :(
Such a tool helps break the cycle here, but such a tool also needs to be used by Microsoft (see Problem 2 above), and there needs to be analysis to ensure exceptions are either handled or the documentation says what exceptions can be thrown. Writing robust code needs to be easier: we cannot just ignore exceptions.
To answer what is in VB 10, have a look at the document on the vb futures site. Basically the list is removal for the need of the line continuation character in many places, collection and array initializers, multi statement lambdas, and generic variance.
I decided to look back at my brief wish lists for VB10
VB 10 thoughts Part 1
VB 10 thoughts Part 2
VB 10 thoughts Part 3
VB 10 thoughts Part 4
VB 10 thoughts Part 5
VB 10 thoughts Part 6
VB 10 thoughts Part 7
VB 10 thoughts Part 8
VB 10 thoughts Part 9
Seems I did very poorly. The only match I got was number 6 multi statement lambdas. I should have had generic variance in the list considering that’s something I wanted since I first saw .NET generics although that really is a framework thing not a language thing. The continuation character, collection and array initializers all seem nice, but functionally trivial to void. Ironically, C#. which has many of those things on my list also picked up a couple it didn’t such as dynamic and they implemented optional parameters as they should be. I must admit that hurts, especially as the optional parameters issues was my #1 item.
For some reason in this new era of supposed language parity, I feel short changed :(