Live data from Hacker News

Let's Rewrite Everything

martinpeck.com

41–50 of 61 posts

Re: Let's Rewrite Everything

#41
post #6

This is madness. There's no real advice about rewrites in this article. The reality of rewrites is that they often fail, cost a ridiculous amount of time and effort, don't actually fix the original problem and/or bankrupt the company. You can't just wave away those realities with "think about the downsides". I have participated in a few (small) rewrites that were successful, and this would be my advice: Don't rewrite…

That's why proper module and interface matter (and tests). With that you can swap one bit with another implementation with less risk of failure. It's a fine grained migration path in a way.

Re: Let's Rewrite Everything

#42
post #6

This is madness. There's no real advice about rewrites in this article. The reality of rewrites is that they often fail, cost a ridiculous amount of time and effort, don't actually fix the original problem and/or bankrupt the company. You can't just wave away those realities with "think about the downsides". I have participated in a few (small) rewrites that were successful, and this would be my advice: Don't rewrite…

> The reality of rewrites is that they often fail, cost a ridiculous amount of time and effort, don't actually fix the original problem and/or bankrupt the company.

The reality of rewrites is that they're often blamed for all of that, while the issue is not the rewrite. The issue is that companies that write bad software will, if given an occasion, write bad software again.

The issue with rewrites is actually that they're not large enough in scope. When you rewrite software, you should probably also rewrite contributors' interactions, the way the company handles power dynamics and, occasionally, the way accounting works at that company. Short of systemic changes, rewrites are likely to fail. But again, the company is also likely to fail other initiatives aswell.

Rewrites that fail in an isolated way are few and far between.

> Before you start a rewrite, consider refactoring and rearchitecting the old codebase, there might be a gem in there that just needs some love and attention.

OR it might be a dumpster fire that drives your engineers away, one that is fueled by unreasonable deadlines and expectations. Also good luck refactoring your codebase at snail's pace with noncomitting approval, on your own unpaid overtime.

Re: Let's Rewrite Everything

#43
Rewrites (and other forms of greenfield development) is an important part of my work environment and compensation. Any equation on rewrite vs. maintain that fails to account for what the company and its employers want to be doing will miss an important factor. The ROI of a rewrite isn’t only in new features or performance or subscribers, but in staff retention and overall happiness.

Re: Let's Rewrite Everything

#44
post #6

This is madness. There's no real advice about rewrites in this article. The reality of rewrites is that they often fail, cost a ridiculous amount of time and effort, don't actually fix the original problem and/or bankrupt the company. You can't just wave away those realities with "think about the downsides". I have participated in a few (small) rewrites that were successful, and this would be my advice: Don't rewrite…

>The reality of rewrites is that they often fail, cost a ridiculous amount of time and effort, don't actually fix the original problem and/or bankrupt the company.

Citation needed.

All of these is based on random internet wisdom (e.g. Joel's condemnation, based on a different era, different delivery model, and different concerns than most of today's startup and enteprrise code), and anecdotal evidence.

Well, talking of anecdotal evidence I've seen lots of succesful rewrites, that made the thing faster and better.

Heck, most/all of the FAANG stacks are rewrites. Twitter, for example, as you've mentioned yourself, is not the same program that needed restart every day to avoid a memory leak back in the 00s - they rewrote it. Reddit is not the original Lisp, and so on.

It's also about the scope. You immediately undestood "let's rewrite the whole company code" and advise "don't rewrite the whole project". Well, who said it's "a" project to begin with?

Companies more often than not have tons of different services, and rewrites can be easily done for such isolated services (e.g. like the dl.google.com rewrite into Go).

Tons of core services of YouTube, CloudFlare, Google, Facebook, and tons of others have been rewriten with languages as Go, Rust, Hack, etc. and they have written about the experience and results as a success. And it's not like survivor bias, e.g. the keep mum about failed cases, because we hear about failures all the time (just not concerning rewritings).

Re: Let's Rewrite Everything

#45
post #13

Earlier quoted context omitted.

I'm convinced that bad rewrites happen because coders get bored and care more about the possibility of a little bit better code, then the whole future of the company. Necessary rewrites happen because they did too much YAGNI thinking in version 1.

It annoys me so much that after honing my skill as an engineer for 15 years now I still fall into the trap of not enough YAGNI thinking. There's a precarious middle ground there for sure. Even though I still fall into the trap of over designing, I believe it's way worse than under designing. I don't remember a single instance where a 'YAGNI' under designing cost us much except designing and implementing the feature t…

YAGNI is difficult to get right because we can't see into the future. There's certainly been plenty of times where it would have been great if something was designed from the start with the new functionality in mind instead of having to hack it in. But there's also many times where thinking that we would need something that we didn't created maintenance and performance overhead.

Re: Let's Rewrite Everything

#46
A co-worker was adamant we needed to spend six months to re-write the application we were responsible for. As near as I could tell, his reasons were the following:

- The application was complicated, - The application was written in Ruby, and he didn't like Ruby. - Golang was way cooler.

Fortunately our director pointed out that there was no customer value to a rewrite, so the idea was shelved.

Re: Let's Rewrite Everything

#47
Depends on the market for the software. Personal experience of those proposing rewrites usually is tainted with NIH syndrome. Different strokes for different folks but refactoring to modularize for targeted rewriting is more viable. New code means new maintenance headaches and probable maintenance on legacy codease.

Re: Let's Rewrite Everything

#48

Earlier quoted context omitted.

I have participated in a handful of rewrites. Most of them were indeed unnecessary or harmful. However, "X2" was definitely an example of an appropriate rewrite. It had the following conditions: * The existing code "X" was the product of an early-phase startup which hadn't yet figured out what it was going to do. "X" already existed at the point we were still asking questions like, "Who is the customer?" with possibl…

May I ask you something? In your experience, how would you approach the rewriting of an application with a mix of front end and back end code, bloated code from years of patches without any planning for a maintainable design (full of unused/buggy classes/methods/features), lack of tests and barely any documentation explaining its processes?

I have never done what you describe, and so I can't say "from my experience".

However, I would say that Job #1 is to identify what the end users (and the customers if the two are different) think this does. Reproducing the system they use/ paid for is the important goal of the rewrite, by definition if you can't fill that role you failed. Technical considerations (it would be nice to have Continuous Integration, it should be in C# not Java, it should run in the Cloud) are necessarily less important.

If you currently have little or no documentation this process produces valuable documentation and it concentrates you on what's important versus unimportant in a way that studying the existing software as a programmer does not. The trickiest code in the software could be so vital that without it your rewrite is useless or equally never used and you can't figure that out by staring at the program's code.

Once you have that high level you're in better shape to drill down and then I think you're in a better place to figure out if a rewrite is appropriate versus maybe you can refine the existing software.

Re: Let's Rewrite Everything

#49
post #6

This is madness. There's no real advice about rewrites in this article. The reality of rewrites is that they often fail, cost a ridiculous amount of time and effort, don't actually fix the original problem and/or bankrupt the company. You can't just wave away those realities with "think about the downsides". I have participated in a few (small) rewrites that were successful, and this would be my advice: Don't rewrite…

> This is madness.

Pretty sure the article is tongue-in-cheek satire.

> There's no real advice about rewrites in this article.

The actual advice is in the top image which goes:

- Todo: Add critical customer request, fix bugs, new features

- In progress: Rewrite everything

Re: Let's Rewrite Everything

#50

Earlier quoted context omitted.

I have participated in a handful of rewrites. Most of them were indeed unnecessary or harmful. However, "X2" was definitely an example of an appropriate rewrite. It had the following conditions: * The existing code "X" was the product of an early-phase startup which hadn't yet figured out what it was going to do. "X" already existed at the point we were still asking questions like, "Who is the customer?" with possibl…

May I ask you something? In your experience, how would you approach the rewriting of an application with a mix of front end and back end code, bloated code from years of patches without any planning for a maintainable design (full of unused/buggy classes/methods/features), lack of tests and barely any documentation explaining its processes?

Start a new company and eat the old bloated ones business...
Post reply on HN