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".
Posts made by michiel1978
-
RE: ASP.NET 2.0 Web Site Administration Tool
-
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>
</td>
</tr>
<tr height="1%">
<td>
</td>
</tr>
<tr height="1%">
<td>
</td>
</tr>
<tr height="1%">
<td>
</td>
</tr>
<tr height="1%">
<td>
</td>
</tr>
<tr height="93%">
<td>
</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. -
[C#] Connect to DB in constructor
Is it generally acceptable to connect to a database in your constructor?
Background: DB queries are 'expensive', and it might constitute a WTF if most programmers would not expect a constructor to do this kind of work.