Friday, November 2, 2007

RubyConf 2007: Hurting Code for Fun and Profit

Ryan Davis belongs to the Seattle Ruby Brigade.

This talk is more about improving yourself than it is about improving your code.

Ruby sadism (deriving pain from inflicting pain on software; especially bad software).

Ruby asceticism (self-restraint)

Introspection Driven Development (self-introspection, that is)

It starts off with a hilarious story about a developer going to a new place (project, department, company, etc). Legacy code is any code you haven't written yourself. After moving to a new place, developer finds a rats nest of code. Developer has two options:
  • kill the coders who wrote the code and maim the others
  • hurt the code
Moral of the story: People will press charges if you hurt them; Code won't. (You have to see the video of this talk for the full impact.)

Examples of hurting code:
  • Write a test for a bug you found
  • Ripping out cleverness
  • Squashing bad design
For some reason, people love complexity.

Introduced ruby asceticism with a clip of the monks from Monty Python. It is where you eschew needless complexity and overly-clever code.

As his favorite manager says, "big alligators, little alligators, swamp." Before building a castle on a swamp, you need to take out the big alligators before you take out the little alligators,

You need to improve yourself. Read quality technology books and blogs. Analyze yourself. Feedback loop.

He raves about c2.com.

Tools to help you:
  • autotest
  • flog
  • heckle (fuzzing, but meaner)
Coverage tests do not ensure the quality of the tests.

He uses something that reads his meta comments (refactor, fix, ...) and gives him a report of the most painful files.

You have to love or hate your code. Either is preferable to apathy.

This is by far the best talk of the day.

"What do you do when you work with someone who writes bad code?" Effectively he said to distance yourself from them and code around them. Is there a better answer?

"Is pairing useful to you?" Yes. He finds there is about a 250% output benefit when pairing, as opposed to coding alone.

No comments: