This post originated from an RSS feed registered with Ruby Buzz
by David Heinemeier Hansson.
Original Post: Reuse is vastly overrated
Feed Title: Loud Thinking
Feed URL: http://feeds.feedburner.com/LoudThinking
Feed Description: All about the full-stack, web-framework Rails for Ruby and on putting it to good effect with Basecamp
Context beats consistency. Reuse only works well when the particular instances are so similar that you're willing to trade the small differences for the increased productivity. That's often the case for infrastructure, such as Rails, but rarely the case for business logic, such as authentication and modules and components in general.
And even at the infrastructure level it's really, really hard. I believe Rails works so well because it was all created with a coherent vision. When you try to hard to reuse, you'll often end up with a frankenstein of slightly different approaches and philosophies that creates rough, unpolished surfaces that simply can't make you happy because it can't be beautiful.
Finally, the new economics of dynamic languages like Ruby simply makes reuse a lot less attractive. Since the cost of producing new, original code is so much lower, the demands on reuse are that much greater. And usually that means it'll take more time to reuse something than it'll take to create it from scratch. Leaving you with something that's both more expensive and uglier.
Note: This is not an invitation to start a copy'paste rampage under the guise of context over consistency. Don't be a dummy.