VB.NET 2.0: Option Strict in code-behind files

12 01 2008

Being a C#-leaning programmer in a VB.NET world most of the time, I find myself cringing a little when I find out most architects or developers on my projects are not enabling the Option Strict option in their projects. Option Strict causes a developer to be cognizant of the implicit casts they are putting into their code, adding another layer of protection against data loss and runtime errors. With just a little extra work, you can spend less time testing or tracking down such errors.

Anyway, enough rhetoric, there’s plenty of information online on what Option Strict provides for you. The reason I’m here today is to share a tip on how to enable Option Strict in your code-behind files in a VB.NET web application (or web site). You can enable this option of course in each page/code file, but I recommend making it a global project setting.

Unfortunately, the Microsoft KB article that addresses this doesn’t work. Those web.config settings do not work. However, after some Google-ing I found an ASP.NET forum post addressing this issue. Here’s what you need to add to your web.config:

<system.codedom>
    <compilers>
      <compiler compilerOptions ="/optionexplicit+ /optionstrict+" language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </compilers>
  </system.codedom>




Bloglines beta

12 09 2007

A few weeks ago (I believe) Bloglines unveiled a separate, beta version of an upgrade to their online newsreader. It is available here, just login with your existing user information.

I’ve been testing/switching back and forth between this beta and Google Reader. I gotta say I like love this new beta! It’s much quicker to load than Reader in every browser I’ve tried and the appearance is more appealing to me (always had an issue with Google’s choice of colors/fonts, even using Greasemonkey hacks). Plus you can now reorder your feed list via drag-drop, and it has a 3-pane view that I’ve found myself using for almost all feeds.

Only drawbacks so far: I’d like to use the Quick View for reading feed items, but unfortunately I haven’t found a way to collapse a news item once it’s opened, making for more scrolling than I like. And I’d still like to see them do pinning similar to Starred Items in Google, so they don’t clutter up my viewing of new items within a feed.

But they have been releasing new features and migrating old ones as time has gone on. In just a couple of weeks they’ve updated the default theme to use more bold fonts and added back in pinning, to name a couple. And watch what happens when you hit the ~ key on your keyboard. Who knows where that is going :)

So expect to see more happen as the beta progresses.

Now I’m no power RSS user, so I can’t critique much beyond that, but especially if you’re a non-power-user like me, I’d highly recommend giving it a try.





Here’s a daily WTF for ya’

26 06 2007

Ha! Nerd post here. Fired up IE today to check my work email. All I got was this:

MSN error

Sweet! I’m not the only one to do that!