Let the code speak for itself

Monday February 11, 2008 @ 11:16 AM (PST)

According to Steve Yegge’s latest epic blog rant, I’m a n00b because I like pretty code. But apparently my love for dynamically-typed languages makes me less of a n00b. I’m so confused!

Joking aside, I couldn’t agree more with his main point, which is:

I think we can learn some lessons from code-commenting: don’t try to model everything! You need to step back and let the code speak for itself.

Hear, hear!

Comments

I think your example code doesn't come quite to the level that his "storybook comments" reach... it's informative and compact enough, I think.

I agree with letting code speak for itself. Another reason I alias :to_s :soliloquy. ;-)

I got this from “Code Complete” IIRC, years ago. Write pseudocode, then the real code. The pseudocode becomes high-level comments describing intent. You can speed read through the code when you come back later.

I’ve seen some really bad code (some even with comments) where you had no clue what the authors original intent was.

Copyright © 2002-2012 Ryan Grove. All rights reserved.
Powered by Thoth.