Sunday, May 24, 2009

Lessons from Robert Martin Keynote (What killed Smalltalk could kill Ruby too)

Robert Martin gave the keynote at this years Rails Conf. Beside learning about some programming history and other interesting bits of knowledge , there are a few lessons that most developers can take away from the talk.

1. Clean Code has zero WTF/min

Most interesting  way of measuring if the code is clean. All programmer should take note of this. Even when i read my own code after some time, I tend to think "WTF, what made me write that crap".

Peer review and refactoring helps in this aspect but many development teams don't do it. It takes quite a lot to make programmer's write tests when we are always faced with deadlines.

One reason is that during school,  TDD isn't really emphasized when doing software projects. Perhaps, universities and polytechnic should start teaching people what are good practices, things like Design pattern's, TDD, source control and so on. Grade projects not only on the functional and design aspects but also on the practices aspect. See if they write tests and see if their tests are maintained still work when the project is done.

2. Rules/Laws of TDD
The laws


  1. You may not write production code until you have written a *failing* unit test.



  2. You may not write more of a unit test than is sufficient to fail, and not compiling is failing.



  3. You may not write more production code than is sufficient to pass the current failing test.



3. Professionalism
Robert also talks about what being professional means. Simple to say it means not bowing down to fear and not taking corners when the going gets tough.

[youtube=http://www.youtube.com/watch?v=YX3iRjKj7C0&hl=en&fs=1]

Links

RSpec
Ward Cunningham on Wikipedia
Ward Cunningham on Twitter
Robert Martin's Page at Object Mentor
Robert Martin Page at Wikipedia
Rules of TDD

No comments:

Post a Comment