ASP.NET 2.0 Web Site Administration Tool



  • I noticed this software does not work very well on my machine, so I decided to take a look at the code. It is written by Microsoft in ASP.NET and targets ASP.NET, you'd expect it to be good code. Here's some examples (you can find the code in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles):

    <font face="Courier New">private bool IsTestable(string providerName) {
        if (providerName.Contains("Sql")) {
            return true;
        } else {
            return false;
        }
    }</font>

    And:

    <font face="Courier New"><script runat="server" language="cs"></font>

    instead of

    <font face="Courier New"><%@ page language="C#"></font>

    The first one is not correct, the second would have enabled code highlighting for the script block in Visual Studio.

    Also:
    <font face="Courier New">
    <tr height="1%">
        <td>
            &nbsp;
        </td>
    </tr>
    <tr height="1%">
        <td>
            &nbsp;
        </td>
    </tr>
    <tr height="1%">
        <td>
        </td>
    </tr>
    <tr height="1%">
        <td>
            &nbsp;
        </td>
    </tr>
    <tr height="1%">
        <td>
        </td>
    </tr>
    <tr height="93%">
        <td>
            &nbsp;
        </td>
    </tr></font>

    That last one shows me that even in 2005 Microsoft still doesn't understand basic HTML and CSS. There's probably more small/medium WTF's in the code, haven't bothered to look at it more than this.



  • I especially hate if(condition){ return true; } else { return false; } stuff, something about redundancy and stuff.

    as for the html, it looks like microsoft was using it's own tools and used frontpage to write the HTML part.



  • Wel the first function looks at a string, if it contains "sql" it can test something. But the thing it tests is in no way related to name you give it. So if you decide to name it "Whatever", a test might work, but you won't be able to test anything, since the name you chose doesn't contain "sql".


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.