Thursday, May 24, 2007

On the virtues of crap code

Sometimes you just have to wonder what people are thinking. What level of software engineering degree does it take to completely misunderstand a concept and write this very special code?

SqlConnection conn = _db.GetConnection();
SqlTransaction tx = conn.BeginTransaction();
SqlCommand cmd = this.GetCmdRemoveField(conn);
cmd.Transaction = tx;
cmd.Parameters.Add("@ID", id);
cmd.Parameters.Add("@FieldName", field);
cmd.ExecuteNonQuery();
tx.Commit();
conn.Close();
try { tx.Rollback(); }
catch { }
conn.Close();


My eyes bleed and my heart sunk as I found this code from an external development group that was developing part of the previous application I worked on.

kick it on DotNetKicks.com Shout it

No comments: