I am very happy to see that Microsoft reversed its decision about who must opt-in and -out for standards compliance when IE8 rolls out. I’m pretty sure enough pressure from some of the bigger names in Web development had a lot to do with that. Or, perhaps, they came to the conclusion themselves that it was just a horrible decision in the first place.
Either way, score one for standards.
I have found a bug that only occurs under very specific circumstances as far as I can tell. My setup is Visual Studio 2005 with Visual SourceSafe 2005 as my source control. What I am attempting to do is use XML documentation (I am using C#) to document a class I have written.
I start off with a
summary section, followed by a
remarks section and everything is fine. Next I wanted to add an
example section to show how the class must be configured in the Web.config. That seems harmless enough, so I add the following documentation:
<example> <configuration> <system.web> <httpModules> <add name="WSAuth" type="MyWS.Auth" /> </httpModules> </system.web> </configuration> </example>
The problem with this is twofold. First, Intellisense is trying to identify each of the XML elements in the
example element. Second, when this is documented using Sandcastle, it will not show up correctly.
The solution to this problem is adding
]]> around the example code. This stops Intellisense from attempting to identify the elements, and it will now show up in the help documentation. But instead of being nicely styled in the help document so that it is easy to read, all whitespace is stripped from the help file and the example ends up crunched together like this:
<example><configuration><system.web><httpModules> <add name="WSAuth" type="MyWS.Auth" /></httpModules></system.web> </configuration></example>
Now I know from previous experience that if I add a
code element around the example and CDATA, it will honor the whitespace in the help document and color-code it as well. This is just what I want.
Here is where the bug is introduced. When I try to get my cursor focused on the correct spot in the code using the mouse, Visual Studio hangs. There is nothing that can be done until it finally throws an error (after 10 minutes or so) complaining about a runtime problem, upon which time it promptly crashes. Here is what is says:
I have no idea what is causing this. I do know that if you type <code> and </code> somewhere else and then cut-and-paste you can get around the problem. But it could still hang even while attempting this. I would love to hear anyone’s idea solution to this problem.
Let me preface this post with the following: I have never been a fan of .NET.
My experiences with .NET started when .NET was still in beta while I was contracting at Anheuser-Busch. Another programmer, Prerit, and I decided after much deliberation that we wanted to make the application we would be working on standards compliant. That’s not too much to ask, right? We quickly discovered that using the Web Forms within Visual Studio did not produce standards-compliant source. What were we to do? The only logical thing, we abandoned the Web Forms and wrote everything from scratch. Visual Studio became somewhat of a suped-up Notepad.
And so it went, for two years of development, I never touched Web Forms. Then I left A-B and .NET, at least for a while.
Now I work for TechPhob, and I have recently been put on a C# project for a big bell. I sat in on a workshop where they were introducing us to the client’s environment, and winced (probably visibly) when I found out they would still be using Visual Studio 2003 – I had learned by then that Visual Studio 2005’s Web Forms produced standards-compliant source.
But the real shock, and I guess the point of this post, is that as I watched this workshop, I found, to my horror, that these .NET developers (client side and those working for TechPhob in California) were putting all of the style for the components directly into them. My god! No thought to the cssClass or to setting a properid on the component. These were supposed to be professional .NET developers, and they had no thought to using CSS.
Did they not see the benefits? One of the TechPhob developers had mentioned at one point of his desire to use a MVC design pattern for all new development. So he was savvy enough to recognize the usefulness of design patterns, but not of a very simple and very important one – separate presentation from structure.
So, my general question to all those professional .NET developers out there – do none of you rely on CSS for presentation, or do you just use the easy tools that Microsoft provides?