Friday, March 6, 2009

I Became a Believer of the Locals Window

I never used to use the Locals window in Visual Studio... I mean, why? Really, why? Doesn't the Watch window do exactly what I would want from the Locals window, plus allow me to keep track of other variables? So what's the big deal about the Locals window anyways?

Recently I changed my Visual Studio IDE Settings to a dual-screen model, and I decided to make the locals window a permanent fixture on my second screen. I've been using it occasionally, simply because it's easier and more stable than hovering over the field, property or variable and trusting in my mad mouse skills to prevent accidentally losing my place in the type hierarchy while checking a value. So yeah, it's a little useful I guess... if I have room.

Today, however, I "discovered" a nice new shortcut that has completely converted me to a believer in the Locals window. If I have both the Locals and the Watch window open, I can actually drag and drop variables from the Locals window to the Watch window. Call me a geek, but I think that's pretty cool. It'll even cast objects to the proper types, if you're, say looking at a variable where the declared type is a base class of the instantiated value held in the variable. Bonus. Thank you Locals window.