Kevin Isom

Just a good ol' boy, by-God Virginia-proud and country-sophisticated -- sort of like a John Deere tractor with air conditioning and satellite radio.

September 2008 - Posts

I have mentioned previously some useful tools for web development for IE, and now here are a couple more.

DOM Helper

CropperCapture[16]

This allows you to edit the css of a page much like EditCSS for Firefox

Fiddler

From the site

"Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language."

CropperCapture[17]

A cool feature of Fiddler is the ability to write extensions for it. Definitely worthy looking into

Delicious

And not development related but damn useful (finally) is the Delicious plugin for IE. I have a tonne of bookmarks, keeping them synced between browsers and machines used to be a nightmare. Now I just use Delicious for IE and Firefox on all my machines and my problem is solved....Now if I could just cull some of my 2456 links I have saved I'd be alright.

Posted by kevinisom | with no comments
Filed under: ,

How often have you seen code like this?

   1:  string myAppSetting = ConfigurationManager.AppSetting["key"];
   2:  if(myAppSetting==null)
   3:       myAppSetting = "MyDefaultSetting"

Or worse yet not even do the check, then during the deploy process the appsetting doesn't get copied over to the instance and you get a null reference exception. That is not a good look.

That sucks. But is preventable in code. That's when the null coalescing operator(??) comes in handy.

Example:

   1:  string myAppSetting = 
   2:            ConfigurationManager.AppSetting["key"] ?? "MyDefaultSetting"
And that's it. A very easy way to prevent errors after deployment. Of course it's useful in other scenarios as well
 
Now the story in VB isn't nearly as nice
 
   1:  Dim myAppSetting As String = IIf(ConfigurationManager.AppSetting("key") Is Nothing, _
   2:  "MyDefaultSetting", ConfigurationManager.AppSetting("key"))
There is a gotcha with IIF as well because it's a function and not a language feature.
 
Anytime you can code to prevent error's  and keep the application working it's a win. Of course make note that the default value you set could cause other errors so use appropriately.
Posted by kevinisom | with no comments
Filed under: ,
More Posts