Archive for February, 2009

The Other Kind Of Exception Handling

1 Comment »Written on February 9th, 2009 by
Categories: Opinions
    public class Developer
    {
        // lots of other methods here....
 
        public void FigureOutException(Exception e)
        {
            var exception = GetMostInformativeStuff(e);
            Read(exception.Message);
            GoToThePartOfCodeThatCausedTheException(exception.StackTrace);
 
            if (YouUnderstandTheProblem())
            {
                FixIt();
            }
            else
            {
                AskForHelpFromCoworkerOrGoogle();
            }
        }
 
        private Exception GetMostInformativeStuff(Exception exception)
        {
            if (exception.InnerException != null)
            {
                return GetMostInformativeStuff(exception.InnerException);
            }
 
            return exception;
        }
 
        private void Read(string message)
        {
            // in most cases, the exception message is pretty clear as to what the problem is
            // this isn't always the case though, but you should at least read the message!
        }
 
        private void GoToThePartOfCodeThatCausedTheException(string stackTrace)
        {
            // open the first file in our code that occurs in the stacktrace, beginning from the top and look at the
            // line number that is listed within that line... this is usually the first place to look
        }
 
        private bool YouUnderstandTheProblem()
        {
            // if the exception message makes sense, and the stacktrace points to line that threw the exception, you
            // will be able to figure it out (in most cases)
 
            // not really correct randomness, but it shouldn't be truly random in real life either
            return new Random().Next(0, 2) == 1;
        }
 
        private void FixIt()
        {
            // ...
        }
 
        private void AskForHelpFromCoworkerOrGoogle()
        {
            // ...
        }
    }

Shouldn't this be common sense?

Poll: What Will Silverlight’s Future Look Like?

15 commentsWritten on February 8th, 2009 by
Categories: Silverlight

I'm currently working on a project at work where we're using Silverlight for the UI. I wasn't a big fan of Silverlight before i started working with it, but you can consider me converted from now on. It truly is a compelling development platform, and i believe it will be the best choice for a lot of web applications (note that i'm not saying it would be the best choice for all web applications) for the next couple of years.

But it appears that the people who feel this way about Silverlight's future are in the minority. You don't see a lot of the really big name .NET bloggers talking about Silverlight (although there are a few), though i'm hoping that will change over time. In the meantime, i'd like to know what you think Silverlight's future will look like. I've put up a new poll with the following possible answers:

  • It's never going to take off in a meaningful way
  • It might pick up some steam for media-related purposes, but that's about it
  • It will pick up more adopters as the platform matures and offers more out-of-the-box capabilities for typical business applications
  • It's too different from traditional web development to appeal to most web developers
  • It will reach wide adoption, but never more than that of typical web apps
  • Someday it will be the default development platform for .NET web developers

(NOTE: for those of you reading this through the RSS feed, the poll is only accessible on my site and is located at the top right corner of the page)

There will obviously be some missing options, so feel free to point them out in the comments. I'm looking forward to the results and your thoughts on this topic :)

What’s Wrong With This Picture?

6 commentsWritten on February 2nd, 2009 by
Categories: What's Wrong With This Picture

wrongonsomanylevels

Books On My Reading List

15 commentsWritten on February 1st, 2009 by
Categories: Books

What does any self-respecting European development geek do when the British Pound's value is so low? That's right, he orders some books from amazon.co.uk to take advantage :)

I now have the following books lying around here, all waiting to be read:

I can't wait to read each one of them, but the book i'm currently reading is Ayende's Building Domain Specific Languages In Boo. I've only read the first 4 chapters so far, but it has already been fascinating.

How about you? Which books do you plan/hope to read in the near future?