Friday, May 18, 2007

Renew Your Developer Vows Now!

Went to a very motivating talk on the importance of writing 'Clean Code' by Bob Martin today and wanted to get my notes to you guys ASAP.

"SmallTalk failed because it was too easy to make a mess."
Ward Cunningham
What can we do about bad code?

  • The Grand Redesign in the sky?
  • Incremental Improvement (of course, the right choice)

Check in a module just a little bit better than when you checked it out!
Never let the sun set on bad code.
Test first!

rspec has better feel and syntax than test unit (we need to start using rspec)

Open/Close principal - application should be open for extension but closed for modification!

Refactoring the way to go - the notion you can write the code correctly the first time is just ego.

Successful refactoring depends on tests. Make small change, test, and repeat until you're done.

eclipse refactorings are back with the rad rails replacement?

separation of concerns, keep things that change at a different rate separate from each other.

Was this worth it?

  • bad code gets harder and harder to clean as time goes by
  • if you want clean code, you have to clean it as soon as it gets messy
  • what about time to market? (the dinner parable) the fastest way to be done with dinner is to just get up and walk away: preparing the next dinner will take forever however

Nothing has a more profound and long-term degrading effect than bad code.

Professional write tests - first.
Professionals clean their code.
Professionals know the only way to go fast is to go well.

"It's about making things a little bit nicer" (DHH)

"Clean Code" project
www.objectmentor.com

No comments: