in

ASP.NET Weblogs

J e r o e n ' s   w e b l o g

October 2005 - Posts

  • Now all I need is a title snippet

    I have to admit, when I first saw the VS2005-integrated code snippets during the TechEd Europe 2004 (yes 2004) keynote, it sounded like the typical feature that I would never use. Well, to make a long story short, I've been using VC#2005 for a couple of days and it's already one of my favorite features!

    Sometimes I would omit handling an exception in some code during development just because it's such a drag to keep writing all that try/catch/finally-stuff. Sure, the handling would make it into the code in the end - if only because some of the unit-tests triggering the exceptions simply wouldn't pass, but still, it's a bit of a risk not including them right away when all the context is still clear to you. So what I do now is this:

    try[TAB][TAB]

    And there it is: a try-block with a catch-clause. And the best part is that you get this in-code-wizard-type functionality to go through all the variable stuff in all these snippets. After that the cursor ends up in the logical next place to start typing. Great stuff!

    Some more cool snippet-shortcuts (just type them in and follow with double TAB): cw (Console.WriteLine), mbox (MessageBox), for/forr (regular and reverse for-loop) and prop/propg (property get/set and just with a get, along with the backing variables).

    Posted Oct 31 2005, 06:54 PM by jvdbos with 4 comment(s)
    Filed under: ,
  • Doing it right means putting it left

    The first thing that hit me when firing up Visual Studio 2005 for the first time was that the solution explorer was docked on the right side of the screen. Funny thing is, it seems the same thing happened to Frans! His motivation of why the solution explorer should be docked on the left side of the screen is correct ofcourse, but while reading the comments one by Bruce Johnson made me laugh out loud, so I'll just paste it here:

    If you plan on keeping your Solution Explorer open, your suggestions make sense. On the other hand, I always keep mine collapsed, so I want it on the right side. Otherwise, when it expands, it covers the code that, as you wisely noted, sits mostly on the left.

    I'm guessing the decision as to the 'default' positioning was one made by committee. "If we collapse it by default, people won't know where it went to. But if we put it on the left, it makes the code jump around. Why don't we just put it on the right". Hence getting the worst of both worlds. ;)

    I remember noticing the default right-side docking when I first installed VS.NET 2003 so it's not a new decision. I remember seeing it on the left by default as well though. It appears to have something to do with the language selection you make when you first start it up: if you select VC++, you'll get the old left-side look from VC++6 (and before), but any .NET-language including C# will give you the VB6-type right docking position. Just goes to show that Microsoft is more concerned with keeping all those migrating VB-users happy than a bunch of those (always-whining anyway) C++ types :)

    Posted Oct 29 2005, 12:00 PM by jvdbos with 3 comment(s)
    Filed under:
More Posts