extreme refactoring

Lasse points to Peter who points to Brian’s article, in which he turns the dial up to 12 in an extreme refactoring exercise. One of his main objectives was to try to get every method down to one line, while simultaneously removing all types of duplication. He appears to have succeeded, and the resulting code is also arguably more adaptable. I’m not sure that it meets all of my own refactoring metrics though. And as Brian himself points out, a nicer language (such as Ruby) would have made both the process and the resulting code much slicker.

I really enjoy that kind of exercise – must do one here one of these days. In particular I plan to refactor a bunch of code towards a hexagonal architecture, just for fun…

Advertisements

One thought on “extreme refactoring

  1. Pingback: language of the year « silk and spinach

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s