Why why why why does Visual Studio 2003 reformat your HTML source when you switch to design view? Supposedly 2005 does not do this, but I’m not using 2005—I’m using 2003. Who in their right mind allowed it to ship like this? Among other things, it:

  • Reformats white space as to render many blocks of code virtually unreadable when you actually do have to code manually
  • Reformats style declarations in a ridiculous manner (e.g., transforming style=”padding:5px;” into style=”PADDING-TOP:5x PADDING-RIGHT:5x PADDING-BOTTOM:5x PADDING-LEFT:5x”) Huh?
  • It generates completely invalid XHTML markup, like capitalizing tag names, not closing certain HTML tags, etc.
  • Converts your layout into incorrect fixed-width dimensions if you accidentally move something that you did not intend to
  • Etc. etc. etc.

I’m at the point where I absolutely DO NOT use design view. Ever. Which sucks, of course, since deciphering the available properties on controls is often nearly impossible, especially when dealing with third-party controls that have lots of design-time properties. My approach now is to always have a throw away tester page—drop your control onto it, fiddle with properties until you have what you want, copy the source and paste it into the real page, then clean up the code as necessary. Do I want to hang myself after doing this hundreds of times? Of course. But my source code stays nice and clean.

I have a coworker who insists on using design view on a project that we are sharing. It is killing me. I just finished changing the width of a div from 650px to 98%. For the fourth time. Why does he continue to use design view? Well, that’s the subject for another post altogether…

Here’s my fictional account of how this came to be. I think I’m probably pretty close. Way back in 2002, some poor Microoft code monkey had about 6 months to pull off 12 months worth of coding on the VS IDE. He reached the point where design view was due in a week and he hadn’t even started working on it. He dug around in the Internet Explorer project in Source Safe until he ran across some prebuilt HTML parsing function that could translate between source code and a visual layout. Sure, it mangled the source aesthetically, but everything still compiled just fine. It would take an extra month to write a new function from scratch that actually worked correctly, but there was not an extra month in the schedule. He thought, “I’ll just stick it in there for now, and when we have time we can clean it up.” Done and done.

Well, Microsoft coder, wherever you are. I’m glad you hit your deadline, but I hope you burn in hell, my friend.