The Pragmatic Craftsman :: Simplicity from complexity ::

What is Good Code?

I recently discovered a pretty good discussion on what “good code” is. The original author, Bill Carlson, specified quite a few good points. Points that according to him make the code good. Before I list the summary of the points, let me just say that if you are interesting in writing quality code, I think you should (you must) read Steve McConnell’s Code Complete. It will open your eyes. It opened mine. :-) (See my review in Books I Recommend.)

Attributes of “Good Code:”

  • High “signal to noise” ratio.
  • Minimal algorithmic complexity.
  • Lack of “cuteness”.
  • Use of most primitive technology required.
  • Appropriate optimization.
  • Architectural simplicity.
  • Specificity (avoiding over-generalization).
  • When vs. How comments. Knowing how to use a class: useful. Knowing when to use a class: priceless.
  • Appropriate quality bar.
  • 100% reachable code.
  • Lack of cut-n-paste.
  • Lack of redundency.
  • Visual clarity. Is the code easy to read?

Read the whole discussion on The Old Joel on Software Forum: “Good Code” – What is it?

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

SOLID principles come in handy here. Especially, "Open of Extension, Closed for Modification." One of the best principles I've learned. - 6 hours agoI actually try to follow @unclebobmartin's rule all the time. Sort of. I try not to make it worse. But to make it better? Great challenge! - 7 hours agoAlways check a module in cleaner than when you checked it out (via @unclebobmartin in 97 Things Every Progr.). I love the idea! - 7 hours agoI 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! - 1 day ago@mcory1 First of all, @unclebobmartin is my hero! Agile Software Development, Principles, Patterns, and Practices is my #2. SOLID rules! :) - 1 day ago