ASP.NET Hosting

Fabrice's weblog

Tools and Source

  • HTML reformatting and Visual Studio: it's a feature!

    This is a followup to my post on the automatic reformatting of HTML/ASPX that happens in VS 2005. You'll be happy to learn that although it looks like it, it's not a bug at all but a feature...
    At first, when you witness automatic reformatting like this, it feels like something bad happens (again). But thanks to Barry Tang and Scott Guthrie from the ASP.NET team, I'll be able to explain you why this happens. Let me try to summarize the rationale behind this...

    What was happening in my case was that <li> tags that I had on distinct lines were all of a sudden all on one line after me changing something in the Design view and switching back to the Source view.
    For example, when I had something like this:

    <ul>
      <li>aaa</li>
      <li>bbb</li>
    </ul>


    it could become something like this after adding a letter:

    <ul>
      <li>aaa z</li><li>bbb</li>
    </ul>


    The reason for this is that VS 2005 tries not to reformat your code, but it doesn’t want to change your page rendering as well. In this case, not reformatting the HTML source would change the rendering of the page in Internet Explorer (not in Firefox though). This is due to the importance of whitespaces in HTML.

    In most cases, whitespaces are very important. Let's take another example. Let's say you have the following markup in source view:

    <html>
      <body>
        <input />
        <input />
      </body>
    </html>


    If you go to Design view, you will see a whitespace between the two inputs. Now, try removing the whitespace between them and go back to Source view. In this case, if VS preserves the newline between the two inputs when we switch back to Source view, it will put the whitespace between the two inputs right back and that would just undo what you did in design view. That’s why whitespace rules take precedence over formatting.

    Something that may be confusing though is the opposite case. If you have this in source:

    <html>
      <body>
        <input /><input />
      </body>
    </html>


    Then switch to design, then add a space between the two inputs, then switch back to source, what do you get?

    <html>
      <body>
        <input />
        <input />
      </body>
    </html>


    Why is this happening? This is due to another rule: the default behavior for "empty" tags is to have a line-break before and a line-break after. You can see this or change it in "Tools | Text Editor | HTML | Format | Tag Specific Options".
    When you know why it happens, there is no problem. But when you don't, which is highly probable when you first work with VS 2005, you have to admit that it's funny to see that when you expect to have your tags on separate lines you end up having them on one single line, and when you expect to have them on one single line, then end up on several lines!

    I hope this explaination helps you to undertand why we can see some reformatting happen. I'm sure that for everyone who see this at work without this kind of explaination will think it a bug. But it's not, it's actually a useful feature. It's just that it's not an obvious one.
    The thing you have to keep in mind is that ASP.NET and Visual Studio teams think that it is more important to preserve rendering. And I agree with them.

  • Post-Whidbey work for Microsoft

    Microsoft's developer division is now engaging on MQ, a milestone that is post-Whidbey and pre-Orcas that will focus on quality.
    This sounds good. A focus on quality is always good.

    But Eric, are some of you working on the upcoming VS 2005 service pack? It's good to focus on quality at a high level, but a lot of small quick fixes are needed too, and much sooner than Orcas, please.
    It would be good news to see Microsoft really commit on delivering patches for Visual Studio... this time. It's not good to delay fixes to major releases of the products. In the meantime, people are working with your products, and there are known bugs that could be fixed with intermediate releases or patches.

  • Ever tried Google AdSense to get some money from your sites?

    Of course, everybody knows about Google AdSense, the program that allows to monetize your web sites...
    Well, now they have a referral program, hence the picture you can see on this weblog's menu.
    Until now, I've been very happy with AdSense on my own sites and on this weblog. If you plan to use AdSense yourself, feel free to click on my referral banners. That would be nice :-)

  • Microsoft is big. A big follower.

    I've just read an interesting post from Scoble (a Microsoft employee) where he writes that Google has disrupted the businesses of Yahoo and Microsoft.

    This got me thinking one thing about Microsoft. For Microsoft employees, everything should be Microsoft and Microsoft should be everywhere.
    The problem for them is that the world is moving so fast nowadays that they can't keep up and are lagging behind. Last time I saw Steve Balmer, he was all after Google and Yahoo. It's a real obsession, a blinding one I'd say. And we can now see the results and where Microsoft is heading.

    How come Google is so strong nowadays? Did they try to copy something? Well, now they are, on some projects, because they can't stay in there own corner and have no choice but to compete with some other market players. But at the beginning they came with something disruptive (like Scoble says). Something that turned out big.
    What is Microsoft doing lately? It is running after Google like crazy, trying to duplicate everything Google does (search, map, portal, etc.). The result: lower quality products, no innovation. Why can't Microsoft come up with something new, something original, instead of trying to be everywhere, and in the end going nowhere? Come on guys, you can do better.

    If we look at live.com for example, it does not look good. No Firefox support? You gotta be kidding? Crashing IE? Great!...
    Experiences like this will harm Microsoft's image. This company already looks like a follower. Now it will look like a bad one.

    I am not a Microsoft employee, so I don't really care. I just find it interesting. It's fascinating to see all this happen from an outside viewpoint.

    Update: Scoble has another post about the subject.

  • Windows everywhere, step 2

    Windows Live: Scott Hanselman doesn't get it.
    I don't need these products either, we have other products elsewhere.

    But my point is that I'm not so sure the new "Windows" branding everywhere will be good for adoption...
    This change is already happening for developers, as we noticed already, but I do not think that it's such a bright idea. I think it's even worst for web sites and general consumer products. How do you feel about search sites or webmail sites that are tied to the Windows name?

    Update: I've just tried live.com... With Firefox: "Firefox support is coming soon. Please be patient :-)". Silly. But wait. With Microsoft Internet Explorer: "IEXPLORE.EXE - Application Error - The instruction at "0x63644648" referenced memory at "0x0000001c". The memory could not be "read". - Click OK to terminate"!!! No comment.

  • HTML reformatting and Visual Studio: it's not over!

    I thought one of the high priorities for Visual Studio 2005 was to get rid of the reformatting of HTML or ASPX code... But I was wrong! I am currently working with the RTM version, and to my great dismay, I can see that Visual Studio still kills my tags' layout and reformats it without notice.
    This is really bad news. I thought we would be freed from this pain :-(

    Update: the explaination is available.

  • Virtual machines everywhere

    The Visual Studio Hosted Experience allows you to either evaluate Visual Studio, or learn how to build applications for Windows and the Web with the MSDN Virtual Labs. Multiple subjects are covered, but what is interesting is that it lets you use a virtual machine to test the products.

    This really looks like the future to me: no need to own a physical machine, but instead multiple virtual machine you can get access to from anywhere.
    Join and use your personal workstation from the airport, from an Internet café or from wherever you want! No need to reinstall or setup everything each time you arrive somewhere. Access your office machine right from your laptop through a wireless connection.
    Soon, you'll have a virtual machine for working, one for gaming, one with VS200X, one with SQL Server 200Y, and they can be active at the same time and see each other. Preconfigured virtual machines will be available and you'll just have to make a copy to start using them. Backups turn easy: just archive copies of the virtual machines.

    Not a lot is missing to get to this picture. Just a little bit of bandwidth maybe?

    How does this sound? Will we see a new business soon: virtual machine hoster?

    Update: As Eric suggests in a comment, we may indeed carry virtual machines around on USB keys or portable music players.