News for hackers. Stuff that matters.
Re:Jason Fried - 10 Things We've Learned at 37Signals by BrandonM on Thursday September 18, 2008 @01:02AM (#307897)
This seems like a great idea if you are committed to immediately refactoring. The problem is that most people move onto something else as soon as they have something that works. In this case, the code becomes a maintenance nightmare until someone actually takes the time to refactor it.

When immediate refactoring is unlikely (either due to laziness, lack of focus, or feature deadlines), some kind of balance has to be reached on what should be more general and reusable and what should be hard-coded and specific. And then we're right back where we started.

But reading and thinking about your posts has been very insightful. On my next project, I will try your approach. I agree that in the long run, it is likely to be a more efficient use of time. I imagine, though, that someone coding in this style will either have to have a great memory or take good notes in order to know where similar code is located. Especially consider the case of generalizing the code from one project to another project.

Re:Jason Fried - 10 Things We've Learned at 37Signals by edw519 on Thursday September 18, 2008 @08:48AM (#308124)
Like I said, it wasn't easy doing it this way. Every bone in my body screamed, "What's wrong with you? Stop replicating code! Write flexible functions!" But I struggled on until everything worked perfectly.

Here's the good news: I couldn't wait to refactor. I was "in the zone" the whole day. And it felt great. I finally got to clean up the mess that I made, and best of all, I didn't have to struggle trying to figure out how to handle that strange outlying case: it was all already there!

I don't know if I'd try this in someone else's shop. You're right; they'd probably pull me off before I got to refactor, leaving a mess for someone else with nothing learned.