4 ms·
Yeah, shipping something real is important, so long as you refactor long-term. Technical debt piles up. A car payment is manageable; a car payment, medical bill
by nthj 14y ago
Yeah, shipping something real is important, so long as you refactor long-term. Technical debt piles up. A car payment is manageable; a car payment, medical bills, and an upside-down mortgage can cripple you.
So it is with software.
- bigiain 14y agoWisdom from comp.lang.perl.misc from the mid '90s, that's served me well my whole career: "_Always_ throw away the first version." It provides two major benefits: 1) it lets you give yourself permission to take unwise shortcuts and h=just hack it together til it works, because 2) you've agreed with yourself it's going to get a ground up rewrite, which you'll approach with a much better understanding of the problem (and the solution and the customers and...)
- gailees 14y agothat's the way to do it!
- chacham15 14y agoYes, but throw it away piece by piece. Often, tossing the whole thing and rewriting from scratch is a bad idea.
- duiker101 14y agoDepends... because if your very first version, which is usually a prototype or a demo, made it to production, I think you might have missed the point.
- bigiain 14y agoAhhh yes - we all start out with the best of intentions, but I still somehow occasionally end up with what _I_ thought was prototype/demo code out there in production. (I'm much more careful these days about either writing properly secured "demo code", or at least hard-coding non-routable ip addresses into it - with comments pointing out the lack of security right where someone would need to be looking to change those hard-coded addresses…)
- bloaf 14y agoThere isn't always a long term, I don't think. For example, I am an engineering PhD student. I am currently writing a small application to automate some simulation tasks through the COM interface and output the results to a database. I don't really intend to share the code with anyone, and I only need it to be good enough so that I can add small features without too much trouble. I started with some really ugly C# code, learned some more about OO, and tried again. Now I just have some bad C# code, but its doing what I need. I'm definitely a better programmer now than I am when I started, and maybe if I find myself a free week sometime later, I'll rewrite the whole thing again.
- nthj 14y agoNote I said -refactor-, not -rewrite-. I am not a fan of rewriting apps: developers always underestimate the complexity involved, and then business rules change along the way, and it's just a mess. Refactoring is when you rework a specific section of code, usually that you're about to work on, or just worked on, to be cleaner. It's a long-term approach, and it's how large applications stay maintainable over the long term. For your specific example, you'd leave your app alone. You wouldn't rewrite it, or touch it, until you find a bug, or need to add a new feature, and then you'd rework anything you need to to add the feature cleanly. On a related note, Refactoring by Martin Fowler is a great book, and I'd recommend everybody pick up a copy. It's a beautiful hardcover and looks great on a shelf, too. http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672 http://www.amazon.com/Refactoring-Improving-Design-Existing-...