Code WTF
Why use VBscript with ASP.NET? If that were not bad enough, check out the variable types. I like how the developer (I use the term very loosely) mixes Hungarian notation with Pascal Case. Also, this mess executes in the Page_Load event and is duplicated on all pages.
My favorite part is how the page communicates with the data store directly. Fat clients are here to stay. Design patterns, n-tier architectural patterns, and strong-typed languages are for losers! BTW, WordPress still cannot correctly render code snippets. Lame.
Dim UserName As String
Dim oConn As SqlConnection
Dim oCmd1 As SqlCommand
Dim oCmd2 As SqlCommand
Dim oCmd3 As SqlCommand
Dim aConfig As ConfigurationSettings
Dim strConn As String
Dim strSQL As String
Dim LastActivity As string
Dim MemberID As String = ""
Dim Inactive as BooleanPrivate Sub Page_Load()
Dim dr As SqlDataReaderMemberID = Request.Cookies("Site")("MEMBERID")
strConn = ConfigurationManager.AppSettings("ConnectionString")
oConn = New SqlConnection(strConn)
Inactive = FalseoConn.Open()
If trim(MemberID & "") <> "" Then
strSQL = "sp_Member @MODE='GETLASTACTIVITY',@MemberID=" & MemberID
oCmd1 = New SqlCommand(strSQL, oConn)
dr = oCmd1.ExecuteReader()
While dr.Read()
LastActivity = dr("LastActivity")
End While
dr.Close()
Inactive = DateDiff("n",LastActivity,Now()) > 30
End If
End Sub
Turd Manager
I was just notified that we have zero active bugs on our current project. Hell yeah, we be bad and shit. Well, instead of celebrating; I could not help but think of a particular asshole that used to go FAR out of his way to write bugs on a damn whiteboard!
In addition to his daily crap, the mofo spent countless hours "managing" bugs. Think about this for one minute. The team was using a tool, which supported bug tracking, assignment, routing, and reporting. Why was the turd manager micro-managing the bugs?
Simple, the mofo was "making" work for himself. Hold up, wait a minute. That reminds me of another loser that used to make work for himself. We are surrounded by turds. Watch your step people, turds ahead! Arrgghh.

Didn’t Bother
This is an update to the Why Bother post. Well, I tried to convince myself that it might not be so bad working with "classic" technologies. What the hell was I thinking? I had to smack myself out of it and have officially turned down the project.
No doubt, I made the right decision. I have enough headaches as it is, so I kicked it to the curb. Even with a higher rate, I still think I would have come to the same conclusion. "Not going to happen!"
Why Bother?
I am in the process of signing another project, but think I am going to have to respectfully decline. The request was for someone experienced with the latest and greatest Microsoft technologies. What the heck, I will give it a shot.
Well, I was given access to the source code and quickly learned that the application uses a hybrid architecture comprised of new technologies and 10 year old scripting crap. Ahh, NO THANKS! I am not prepared to go back in time and work with archaic technologies.
Hitting The Pipe
Haha! Look what I found on Craigslist. Does the project background sound familiar? If this is the project I think it is, the problems are not going to be fixed anytime soon. Also, I assure you that the vendor is NOT going to find an architect-level consultant for $60 per hour.
Let me guess, the SQL architect will be billed at a $105 per hour CMAS rate and the vendor is paying only $60. I think I know who the cheap vendor is too!! Does the vendor name start with an "E", "K", "H", or "T"? Losers!
Search & Replace
I had a few minutes this evening, so I whipped up a handy-dandy code sample. The sample illustrates how to use enumerations, switch statement, and the Regex.Replace method. It is not much, but I wanted to share the love. Tell me what ya think! Bruahaha.
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;public class Dinner
{
private enum AttendeeEnum
{
Gman,
Ninja,
Scooter
}
public static void Main()
{
Array attendees = Enum.GetValues(typeof(AttendeeEnum));
foreach(AttendeeEnum attendee in attendees)
{
Console.WriteLine("Attendee: " + getAttendeeName(attendee));
}
Console.ReadLine();
}private static string getAttendeeName(AttendeeEnum attendeeName)
{
string name = string.Empty;
switch (attendeeName)
{
case AttendeeEnum.Gman:
case AttendeeEnum.Ninja:
{
name = attendeeName.ToString();
break;
}
case AttendeeEnum.Scooter:
{
name = Regex.Replace(attendeeName.ToString(), "coot", "tiff");
break;
}
default:
{
name = attendeeName.ToString();
break;
}
}
return name;
}
}
Visual Studio Unit Testing: Creating a Private Accessor
Tried desperately to have Visual Studio to create a private accessor for me today, but every time the Test was created I received this message:
Creation of the private accessor for 'Microsoft.VisualStudio.TestTools.TypesAndSymbols.Assembly' failed
I ran into a bunch of people talking about bugs in VS, but then I tried on another project and it worked just fine. I figured out that I had discluded the accessor file and Test References folder from my Test project. Therefore VS wasn't able to overwrite the file on the file system since it wasn't included in the project. Once I included the folder and Project.Accessor everything worked perfect.
WTF Code Candidate
I just stumbled on another WTF code candidate, so I have to post it. Developers, grab some tissue, because it's going to bring tears to your eyes. Yup, it's crappy code but I have seen worse (unbelievable, but true). Btw, the WordPress code tag still sucks!
- Hard coded connection string [check].
- Embedded SQL (with *, no less) [check].
- Useless Try/Catch block [check].
- Redundant counters and iterators [check].
- Inconsistent naming scheme [check].
- Spelling errors [check].
- Logic errors [check].
Code Comments
This post is not about how important it is to comment your code. We all know the benefits of well written comments. Instead, I stumbled on this gem. I would post it here, but we all know the WordPress code tag sucks. Excerpt:
At this point, I'd like to take a moment to speak to you about the Adobe PSD format.
PSD is not a good format. PSD is not even a bad format. Calling it such would be an
insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format.
Having worked on this code for several weeks now, my hate for PSD has grown to a raging fire that burns with the fierce passion of a million suns. [more]
BTW, there are many classic WTFs on Google Code. I think the best comments I have seen to date are from a consulting company out of Texas that cursed out the clients and other consultants. Morons, everyone and their mother can read your comments!
Max User Connections
I stopped by websiteoutlook.com to check the worth of wassupjose.com. Well, the website had other plans for me. I was greeted with the following error message:
Warning: mysql_connect() [function.mysql-connect]: User admin_wo already has more than 'max_user_connections' active connections in /home/admin/domains/websiteoutlook.com/public_html/sql.php on line 2
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/admin/domains/websiteoutlook.com/public_html/sql.php on line 5
can not connect to database
The interesting part of this post is that the "reported" number of online users was a nudge above 300. Uh, I think we have a problem here. I found this funny, because we had a similar problem on a past project. However, I think the system puked at 20 users. Ha!
