<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>@ Head : Silverlight</title><link>http://msmvps.com/blogs/bill/archive/tags/Silverlight/default.aspx</link><description>Tags: Silverlight</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>What we have here is a failure to communicate</title><link>http://msmvps.com/blogs/bill/archive/2008/11/14/what-we-have-here-is-a-failure-to-communicate.aspx</link><pubDate>Fri, 14 Nov 2008 02:33:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1654086</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1654086</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/11/14/what-we-have-here-is-a-failure-to-communicate.aspx#comments</comments><description>&lt;p&gt;you can tell from the title there’s a Friday rant coming can’t you ?&amp;#160; Well yeh, sometimes what should be a simple task of writing code becomes painstakingly slow.&amp;#160; Take for example this one line of code:&lt;/p&gt;  &lt;div style="font-size:11pt;background:white;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160; &lt;span style="color:#3092b1;"&gt;Dim&lt;/span&gt; doc = XDocument.Load(&lt;span style="background:#feffea;color:#a31515;"&gt;&amp;quot;abc.xml&amp;quot;&lt;/span&gt;)&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now if you like to write robust code, somewhere in your mind there should be that voice saying, “&lt;em&gt;ah but what if the file is not there or can’t be opened or isn’t valid xml&lt;/em&gt; “…etc, etc.&amp;#160; So the first thing you probably think of doing is look at what exceptions the method can throw,&amp;#160; or so you’d hope.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 1&lt;/strong&gt;. VB doesn’t display the exception information from any xml documentation.&amp;#160; Our first failure to communicate that then leads us on a great chase.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 2&lt;/strong&gt;. 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.&amp;#160; The author(s) of XDocument.Load failed to communicate the exceptions that could be thrown.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 3.&lt;/strong&gt; 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.&amp;#160; That little voice in your head that first said “&lt;em&gt;what if&lt;/em&gt; …” is now screaming.&amp;#160; There’s a failure to communicate between Visual Studio and MSDN help.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 4.&lt;/strong&gt; 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).&amp;#160;&amp;#160; The failure to communicate cascades.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 5.&lt;/strong&gt; 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.)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If religious wars were still in fashion, we’d be saying “hey what about checked exceptions al la Java ?”.&amp;#160; The more I am frustrated at how hard it is to write &lt;strong&gt;robust&lt;/strong&gt; code because of these often cascading failures to communicate, the more I want to sign up with the holly sect for checked exceptions.&lt;/p&gt;  &lt;p&gt;An alternative is to provide rich tooling and analysis.&amp;#160; 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.&amp;#160; 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 :(&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1654086" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Rant/default.aspx">Rant</category><category domain="http://msmvps.com/blogs/bill/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Does silverlight really make sense ?</title><link>http://msmvps.com/blogs/bill/archive/2008/03/23/does-silverlight-really-make-sense.aspx</link><pubDate>Sun, 23 Mar 2008 05:24:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1550846</guid><dc:creator>bill</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1550846</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/03/23/does-silverlight-really-make-sense.aspx#comments</comments><description>&lt;p&gt;Earlier today I followed &lt;a href="http://blogs.msdn.com/somasegar/archive/2008/03/21/giving-vs-express-website-a-new-life-with-silverlight.aspx"&gt;Soma&amp;#39;s link&lt;/a&gt; to the updated &lt;a href="http://www.microsoft.com/express"&gt;Visual Studio Express pages&lt;/a&gt;. Soma gave emphasis that the &amp;quot;&lt;em&gt;approach was to add Silverlight without making it look like we just dropped something new into our existing site without any thought&lt;/em&gt;&amp;quot;.&amp;nbsp; Hmmm, could have fooled me ;)&lt;/p&gt; &lt;p&gt;The first thing I noticed (other than having to allow the AgControl Class addon) was with the new site I have to wait for silverlight data to be downloaded.&amp;nbsp; And that is slow.&amp;nbsp; But why do I have to wait ?&amp;nbsp; Seems all that is really being brought down is a series of about 10 slide shows.&amp;nbsp; Sure to the naive they look pretty because the screen shots are on angles, but it&amp;#39;s also incredibly useless. You can&amp;#39;t even navigate through those slides.&amp;nbsp; It&amp;#39;s like it was designed to wow the bosses inside on the corporate network as they sit back and watch the slide show.&amp;nbsp; As far as end user goes, it sucks.&amp;nbsp; Why the hell should I have to wait for (and pay for the bandwidth used by) a useless bunch of slides ?&amp;nbsp; What ever happened to *asynchronous* fetching of data ?&lt;/p&gt; &lt;p&gt;And the big problem for users is they don&amp;#39;t know if they are able to get the same content without Silverlight.&amp;nbsp; Was there any real gain to the user ?&amp;nbsp; Or did it force the user to wait, and in fact make navigation more awkward (such as when you go forward and then go back, you have to sit and wait through the slide show again depending on which slide was relevant to you).&lt;/p&gt; &lt;p&gt;What scares me is that Soma is proud of this usage of SilverLight.&amp;nbsp; I guess that means he must have just sat back and watched the slide-show over the corporate intranet :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1550846" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/Rant/default.aspx">Rant</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Silverlight/default.aspx">Silverlight</category></item></channel></rss>