Live data from Hacker News

Textmate 2 and why you should never rewrite your code

kerr.io

31–40 of 52 posts

Re: Textmate 2 and why you should never rewrite your code

#31
post #21

Earlier quoted context omitted.

Windows NT? The Windows 95-98-Me series' kernel was thrown in the bin, replaced by the NT kernel when they released Windows XP.

NT was created in parallel, and run in parallel for a long time. Eventually the benefits of NT outweighed the 9x kernel, and computers were fast enough that the extra overhead was acceptable. 9x was EOLed and XP went with the NT kernel. They were two different products that ended up converging enough that sharing code made sense.

If there is any lesson from OS X and Windows, I think you've hit on it, exactly. The way to replace isn't to stop one and start another – instead, you need to build in parallel and have a smart migration plan.

Re: Textmate 2 and why you should never rewrite your code

#33
post #16

Earlier quoted context omitted.

Maybe the real lesson here is, don't get in technical debt. Do it right from the start.

If only it were that simple. The problem is that you don't know what the 'right way' is until you've done it once and discovered all of your the mistakes and pitfalls. The temptation then becomes to start over and do it right after having learned your lesson. The problem with that is that often, in addition to taking to long too start over, you just end up making a whole new set of mistakes.

> The problem is that you don't know what the 'right way' is until you've done it once and discovered all of your the mistakes and pitfalls.

Isn't that what experience is? (As opposed to talent.)

Re: Textmate 2 and why you should never rewrite your code

#34

I prefer an alternative interpretation: if rewriting your code is an existential risk, you weren't writing it right in the first place. Startups need to value flexibility. The longer they stay flexible -- even in the presence of growth -- the higher their valuations get. So the conclusion seems inescapable: find ways to make rewrites utterly banal. This may seem hard, but I think it's possible. Part of the answer mig…

Agree. I work for a highly successful startup that has gone through several major rewrites on subcomponents and we're fine. Rewrites are not in and of themselves a universal evil - but writing shitty code is.

Re: Textmate 2 and why you should never rewrite your code

#35

And yet Firefox rose from the ashes of Netscape. Who would have thought Mozilla would become relevant again five years after Netscape died? I'm starting to think open source projects are a lot more hardy than startups because they can't run out of money.

It's possible that Firefox would be more mature or popular than it already is if they never did the rewrite.

Re: Textmate 2 and why you should never rewrite your code

#36
Are there really no instances of rewrites succeeding? Are we sure that projects that failed doing rewrites wouldn't have failed more painfully if they'd continued dealing with the cruft of the old codebase?

It's possible the problem is more in how these projects went about their rewrites, than just the fact that they did. What was the scope of the rewrite - did they simultaneously re-architect, redesign the UI, and try to implement all their hoped-for features (second-system effect)? Did they try to re-use old modules (temporarily or permanently - did they not reuse enough, or did they invest too much time making old code compatible)? Did the entire team immediately switch over to working on the rewrite, or did it get too few resources?

It might be worth investigating how a rewrite could possibly be done successfully, instead of assuming that the only option is to slowly refactor.

Re: Textmate 2 and why you should never rewrite your code

#37
Lessons I took away from the Mythical Man Month:

Version 1: Get to market, prove your product, make a big mess

Version 2: Make a ton of mistakes, screw everything up trying to clean up the mess but get sidetracked with all the great ideas you don't have time to implement

Version 3: Scale back, get smart, and build what version 2 should have been in less time

In my experience, most companies either get completely discouraged or worse yet just wreck themselves on version 2. The nice thing about iterative development is that the V1 - V3 spectrum happens fast and your failures are smaller.

Re: Textmate 2 and why you should never rewrite your code

#38
post #33

Earlier quoted context omitted.

If only it were that simple. The problem is that you don't know what the 'right way' is until you've done it once and discovered all of your the mistakes and pitfalls. The temptation then becomes to start over and do it right after having learned your lesson. The problem with that is that often, in addition to taking to long too start over, you just end up making a whole new set of mistakes.

> The problem is that you don't know what the 'right way' is until you've done it once and discovered all of your the mistakes and pitfalls. Isn't that what experience is? (As opposed to talent.)

But experience can't always prevent mistakes and pitfalls because you can't always predict the future. This is especially prevalent in the land of startups where you can think the most important thing is X, you build a bunch of stuff for it, then 3 months later the most important thing is Y, then a 3 months later the most important thing is Z, and all of the sudden you have a bunch of technical debt.

Even if you could build X, Y, and Z "right the first time" those 3 month transitions may become 6 month transitions, and now you're out of business. (to be clear, those numbers are made up as an example)

There are obviously best practices to be followed so you don't have big screwups or an unneededly bloated system, but sometimes these problems can't be prevented because you can't always predict the future.

Re: Textmate 2 and why you should never rewrite your code

#39
post #35

And yet Firefox rose from the ashes of Netscape. Who would have thought Mozilla would become relevant again five years after Netscape died? I'm starting to think open source projects are a lot more hardy than startups because they can't run out of money.

It's possible that Firefox would be more mature or popular than it already is if they never did the rewrite.

Firefox would not exist without the rewrite. We'd still be stuck using Mozilla.

Re: Textmate 2 and why you should never rewrite your code

#40
I think the idea he's trying to convey is that rewrites are a bad idea IF you already have a nice clean, simple product that works, with a large code base. I've been on projects where the entire code base was essentially trashed, except for some specific reference materials, but the code was terrible, and that was actually a pleasant experience.
Post reply on HN