The Pragmatic Craftsman :: Simplicity from complexity ::

Your Code Sucks

Most likely, it does. Here is an article, Why Your Code Sucks by Dave Astels that will tell you why it does. Read the article as I think it’s great. After you read it, make sure you verify your code according to all of the points. Dave says that your code sucks if it meets the following criteria:

1. Your code sucks if it doesn’t work.2. Your code sucks if it isn’t testable.3. Your code sucks if it’s hard to read.4. Your code sucks if it’s not understandable.5. Your code sucks if it dogmatically conforms to a trendy framework at the cost of following good design/implementation practices.6. Your code sucks if it has duplication.

So, I ask you, does your code suck?

I think some of the code that I write sucks because it isn’t very easily testable. I think, though, that it is hard to test web applications and that’s the main reason behind it. I’m trying to find an easy way to do that so I can eliminate it. I agree with the author, your code should be easily testable. As far as the other points are concerned, I would say that my code is easy to read, easy to understand, and it does not have any duplication. I take extra care in those areas.

Comments are closed.

Random Quote

Topics

Tags

Archive

Recent Entries

Currently Reading

Shelfari: Book reviews on your book blog

:: The Pragmatic Craftsman recommends

:: The Pragmatic Craftsman book reviews

Info

© 2001-2010 Stanley Kubasek About me :: Contact me

@PragCraftsman on Twitter

I put Code Complete #1 over Martin's book because it has "awaken" me as a programmer. But other than that, Martin's book is the best! - hour ago@mcory1 First of all, @unclebobmartin is my hero! Agile Software Development, Principles, Patterns, and Practices is my #2. SOLID rules! :) - hour agoWhich programming book has had the most influence on your career? I have to say "Code Complete" by McConnell - 14 hours agoI have not used Git myself, but see a lot of good buzz about it. Is this anology accurate: Git is to SVN as SVN is to CVS? #git #svn - 19 hours ago