Saturday, November 3, 2007

RubyConf 2007: Tightening the Feedback Loop

Phil Hagelberg belongs to the Seattle Ruby Brigade.

Slides link

I left the other room because the topic was misleading and I wasn't really interested in what it turned out to be. The talk was originally called, "Writing Client and Desktop Applications in Ruby," and was changes to "Deployable Ruby Runtimes." The talk was about release a wholly standalone ruby application.

Testing
  • good - manual tests
  • better - test::unit / rspec
  • better still - autotest
  • a bit better
    • Flymake was released with the last emacs. It throws your buffer at gcc with warnings turned on. There is a port to ruby that throws your code at ruby -w.
    • test-unit.el gives you the some info from autotest, but provides better visualization
You want to tighten the feedback loop of breaking something and being notified of that breakage. You care about your code's accuracy. You use/write tools to help you measure your code's accuracy. You are notified when things go wrong. As you go down the list above, the delta between breaking something and being notified about it goes down.

What to measure?

Accuracy - syntax highlights, indentation, and test/specs. The first two happen automatically in the editor. Tests/specs should be shown there too.

Meta-accuracy - how accurate are your accuracy checks? Use rcov (caveat: don't think this means you are fine) and heckle.

Maintainability - Martin Fowler said, "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." It can't be programmatically measured, but it is correlated to complexity, which is measurable. Use flog (caveat: the scores are relative). How to use it? Measure on a per-commit basis (no patch bombs).

Performance - black box response times (Julian? had a presentation at the last RailsConf that dealt with this. The code was about 50 lines. You should write your own.) and measure test suite times

This talk isn't giving me anything that I didn't hear in Ryan Davis' talk.

He kept bringing up how often do you want to be notified, in each of the categories.

Keep a history of your measurements, so that you can chart your personal growth.

The pragmatic programmer says to learn your editor. You should also learn what you can do for it.

There's a demo of Augment being used in emacs.

No comments: