August Meme Monday – Crap Code

Categories: Meme Monday, News, Professional, SSC
Comments: 3 Comments
Published on: August 1, 2011

Interesting topic this month posted by Thomas LaRock.  This month he has chosen “crap code” as the topic.  I think it is interesting because there really are so many different ways to take this.

Knowing that there are so many qualifications for crap code, I personally like that of readability.  I know everybody has their own interpretation on how code should be written and what is readable.  However, I have to say that soooo many styles out there are not very good.  The style is sooooooo hard to read and follow.  For me, it is a coding nightmare to see code that is poorly formatted or not formatted at all.

[codesyntax lang=”tsql”]


That code is just flat out difficult for me to read.  SQL Server handles white space just fine so a little formatting doesn’t hurt anything.  Better yet, it very well could help improve the readability of your code to more people than just you.  Something like the following helps.

[codesyntax lang=”tsql”]


Now, for simplicity sake, I also introduced something in both of these code samples that I don’t like too much either.  In both cases I use a “Select *”.  This is bad form!  One really should also denote each column that you want to be returned.  Not only is it good for readability, but it can be useful for the query optimizer and indexing purposes.


So what do you consider to be crap code?

3 Comments - Leave a comment
  1. Mark says:

    It bothers me when people use column names (or other user named elements) that happen to be commands or functions. I’ll admit it – I’ve been guilty of it myself, but I avoid it. “SELECT AVG from Mytable.” Noooo! Crap code.

  2. jonmcrawford says:

    Lack of documentation/comments. What the code does != what the code is supposed to/assumed to do.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

August 2011
« Jul   Sep »

Welcome , today is Saturday, December 7, 2019