mutterings of a cynic

Wednesday, June 22, 2005

a channel for my findings

I was linked to this website today. It is a collection of examples of idiocy in coding. Having looked through the last week's entries, this has to be my favourite:
the original programmers didn't really believe in using the WHERE clause when it came to SELECT statements


ResultRecord getDetail(String contactId)
{
String sql = "select * from contacts";
ResultSet resultSet = GetResultSetFromSql(sql);
while(resultSet.hasNext())
{
ResultRecord record = resultSet.next();
if(record.getContactId().equals(contactId))
{
return record;
}
}
}
This website is a pleasing addition to my bookmarks folder. I'll use it as an outlet for the pain I periodically suffer when finding snippets like that. I'll use it often.


0 Comments:

Post a Comment

<< Home