News for hackers. Stuff that matters.
Re:Systems design explains the world: volume 1 by amelius on Sunday December 27, 2020 @01:30PM (#25553112)
> Joel Spolsky wrote Things you should never do, part 1 about the company-destroying effect of Netscape/Mozilla trying this. "They did it by making the single worst strategic mistake that any software company can make: they decided to rewrite the code from scratch."

I'm not convinced. They only show a couple of examples, but there must also be counter-examples.

Re:Systems design explains the world: volume 1 by rswail on Monday December 28, 2020 @04:13AM (#25557824)
I've been involved in a number of attempts to rewrite systems that ticked all of the boxes of Mythical Man Month's second system effect.

The main things I've learned over 40 years:

* Rewrites will fail. Whether they're called that, or called "lift and shift" or called "refactoring"

* The reason they fail is because the focus is entirely on the technology, not the users and how they use the systems

* Understanding business systems and users and how they interact is vital. Business processes haven't changed, accounting hasn't changed, company hierarchies and competitive markets haven't changed.

* What has changed is that where people used to be the "API" for a process touchpoint, now that is likely to be another system, and will have its own API which expresses how it sees the process. Trying to "force" those systems to interact with yours in the way you want is a fools errand.

* Abstraction is really important when defining business domains. "Sales" vs "Fulfilment", "Payment" vs "Charging", "Data" vs "Information", etc.

* Software can't solve all of the possible implementations of the business domain abstractions. You have to set constraints to limit the number of "configuration" elements. Things like "Sales are always retail to end user consumers so that we don't have to deal with VAT exclusive invoicing".

* Those constraints need to be agreed to by the product owners/managers of the domain. Otherwise, every potential requirement will add yet another "knob" to the control of the domain, yet another testing path etc.

Re:Systems design explains the world: volume 1 by l_t on Sunday December 27, 2020 @02:44PM (#25553684)
I've been involved in rewrite-from-scratch projects that worked, because the scope of the system being rewritten was relatively small. So, I've concluded "rewrite from scratch" projects get a bad rap because they tend to also be very big, nebulously scoped projects, almost by definition. But it's totally unrelated to the fact that they're rewriting a codebase, and everything to do with the size and scope of the project to rewrite a codebase.

Either way, though, we're lead to similar conclusions as the article, regarding refactoring. If a codebase/system is too large to rewrite in a single project, you have to break the work into incremental steps. Theoretically the only difference between "refactor" and "rewrite" is the scope of the affected code.

Re:Systems design explains the world: volume 1 by hliyan on Sunday December 27, 2020 @09:58PM (#25556281)
Most writes we do as engineers are rewrites. The only difference is whether we're rewriting a statement, a function, a module or an entire system. You are correct. It is the size of the rewrite that matters.
Re:Systems design explains the world: volume 1 by Twisol on Sunday December 27, 2020 @04:21PM (#25554368)
To put it pithily, when "the problem has moved on from the solution", a rewrite might make sense. What I mean is that the existing software has existed for long enough, without incremental upkeep and rework, that the problem it was originally solving has evolved to the point that the existing software is not only inadequate, it's wholly inappropriate.

I'm part of one of those rewrites right now, and while it's true that it's taken much longer and had other ancillary issues, it's clear that the problem really has moved on, and there are needs that can't be addressed without a fundamentally different solution. It's kind of trading a hard problem for a harder one: we're forced to really understand the domain we're serving, rather than simply reimplement a set of existing capabilities. (But then, I don't think maintainable, evolvable software can reliably be created without understanding the domain to begin with.)

Re:Systems design explains the world: volume 1 by jsnell on Sunday December 27, 2020 @08:36PM (#25555905)
> I'm not convinced. They only show a couple of examples, but there must also be counter-examples.

A couple of counter-examples that come to mind are Windows (with effectively a 15 year long rewrite that required selling both lineages in parallel while keeping the compatible enough) and Mac OS (when transitioning from classic to OS X).

Re:Systems design explains the world: volume 1 by apenwarr on Sunday December 27, 2020 @11:58PM (#25556803)
The original book is about an IBM mainframe OS that was a second system effect project, but which eventually succeeded.

The point isn’t that every rewrite fails, it’s that it makes things really painful and is rarely worth it. The Mozilla rewrite, Windows NT transition, and MacOS X transition all succeeded too, just painfully.

Thus, a counterexample wouldn’t be a complex rewrite that succeeded or failed; it would be one that was surprisingly easy, painless, and shipped on time, with the expected feature set.

Re:Systems design explains the world: volume 1 by qznc on Monday December 28, 2020 @06:44AM (#25558467)
In the article you wrote

> As for solutions, there isn't much to say about the second system effect except you should do your utmost to prevent it; it's entirely self-imposed. Refactor your code instead. Even if it seems like incrementalism will be more work... it's worth it.

That seems to be a misleading conclusion? Maybe the moral is rather that you will probably vastly underestimate the Big Rewrite. If it is still worth it at 10x the estimated effort, you should still do it though (WinNT, OSX, etc). That raises the question if we could improve about estimating such Big Rewrite tasks.

Following that thought, the chicken-and-egg problems collapses into the second-system problem. You need to rewrite incrementally in small steps but it only pays off once you completed all the steps (or at least most of them). Until then you just introduced inconsistency into your codebase. You left a local optimum to go for another one and naturally it gets worse before it gets better. You better plan ahead how to keep moral and management support big enough to cross that gap.

Re:Systems design explains the world: volume 1 by jsnell on Monday December 28, 2020 @02:12AM (#25557378)
I don't understand what you mean by "original book". The comment I was replying to was referring to Joel Spolsky's blog post, which does not talk about IBM mainframes. It also does not merely claim that rewrites are just painful. It ways they are the "single worst strategic mistake that any software company can make".

The counterexample is thus not rewrites that were painless. It's rewrites that were strategic successes, which clearly Windows and Mac OS were. They are, after all, the foundation of two of the world's most successful companies.

Re:Systems design explains the world: volume 1 by rswail on Monday December 28, 2020 @04:19AM (#25557855)
Windows is not the same as Mac OS.

Microsoft was a software company. Other than accessories like keyboards and mice, they sold an OS to OEMs and applications that ran on the OS. They suffered through Windows NT as a transition and the Vista debacle. Without their monopoly market, those could have ended the company.

Apple was a hardware company. Other than MacOS and a few applications, they sold hardware that ran that OS. Their focus was on selling more hardware.

Windows had to maintain compatibility because the OS is the base, there isn't anything lower down. If they lost compatibility, then the argument for running Windows was reduced.

MacOS had to enable the new features of Apple's hardware. If it didn't, then there would be no demand for the new hardware. So the transition of MacOS from M68K to PPC to x86 to M1 is necessary to enable the hardware to advance. To Apple, it's a cost of introducing more advanced hardware features.

Re:Systems design explains the world: volume 1 by tome on Monday December 28, 2020 @06:29AM (#25558392)
> I don't understand what you mean by "original book"

The Mythical Man Month.

Re:Systems design explains the world: volume 1 by l0b0 on Sunday December 27, 2020 @04:32PM (#25554441)
It's telling that 20+ years later Netscape/Mozilla is still the go-to example of why rewrites are a bad idea. That gives us basically three possibilities:

1. Nobody is doing rewrites from scratch anymore. That's just not the case.

2. Nobody is talking about all the failing rewrites causing entire companies to collapse. I don't think anyone is convinced by this argument, it's basically several big conspiracies in one.

3. People have learned how to avoid the same traps, by reading about the Netscape/Mozilla fuck-up.

Basically, the problem isn't rewrites. It's badly managed rewrites.

Re:Systems design explains the world: volume 1 by a1369209993 on Sunday December 27, 2020 @06:09PM (#25555056)
4. Name-recognizable companies are typically bloated enough that they can absorb the damage from a failed rewrite without it being clearly responsible for their collapse.

5. Nobody is admitting to doing rewrites from scratch anymore.

6. Netscape/Mozilla became (due to path-dependence and happenstance) the canonical example, and no other examples have been interesting/memetic enough to displace it.

7. People have learned to keep failing rewrites dragging along until something else causes them to be abandoned, sparing them the label of "failed".

8. Other.

Re:Systems design explains the world: volume 1 by rizpanjwani on Sunday December 27, 2020 @06:45PM (#25555218)
exactly. I can tell you from experience that one of the companies I know had consultants out of texas convince them that rewriting their bread and butter ecommerce system was the way to go instead of improving the older one which mostly worked but had some bugs now and then which could be resolved by their existing internal development team. This was a real disservice that cost the company a lot of time and money on something that had to be replaced again in a year after it was "finished" just so the consulting company could make money and give their developers something to do.
Re:Systems design explains the world: volume 1 by rictic on Sunday December 27, 2020 @08:31PM (#25555885)
Python 3, Angular 2, Polymer 2. Not all full rewrites, but breaking changes with lots of the pain from a rewrite.
Re:Systems design explains the world: volume 1 by jariel on Monday December 28, 2020 @01:07AM (#25557120)
I would add - those are kind of monolithic style app platforms. Big, complicated, installed software.

Most software is services oriented, and it evolves, piece by piece over time.

Is Facebook running any of the same code from 18 years ago?

Probably not?

When did they re-write? They didn't, they just evolved, piece by piece.

Re:Systems design explains the world: volume 1 by tome on Sunday December 27, 2020 @04:55PM (#25554589)
> 1. Nobody is doing rewrites from scratch anymore. That's just not the case.

This claim would be more compelling if it provided a few notable examples.

Re:Systems design explains the world: volume 1 by apenwarr on Sunday December 27, 2020 @05:01PM (#25554635)
Kubernetes is the biggest and worst second system effect I’ve seen in years.
Re:Systems design explains the world: volume 1 by qznc on Monday December 28, 2020 @06:52AM (#25558510)
Is it an instance of the Second System Effect if you build something slightly different?

Google is replacing its internal systems all the time. For example, MapReduce was replaced with Cloud Dataflow [0].

[0] https://www.datacenterknowledge.com/archives/2014/06/25/goog...

Re:Systems design explains the world: volume 1 by l0b0 on Sunday December 27, 2020 @05:42PM (#25554901)
I worked on one rewrite of an old system which I can't really talk about, but which was very successful (the only thing we kept was the data). I also remember reading many years ago that every major version of Windows is essentially a rewrite from scratch.
Re:Systems design explains the world: volume 1 by glogla on Sunday December 27, 2020 @06:07PM (#25555040)
We just deployed rewrite of Hadoop (sqoop, hive, ...)/Teradata based Data Lake & Data Warehouse to Cloud based Serverless Lakehouse with Spark as the main workhorse.

This included migrating about 1/2 petabyte of old data and rebuilding several Kimball-style Data Marts to Data Vault approach, which pairs really well with the Lakehouse-style tech stack.

This all took about 9 months, which is a long time, but it was in highly regulated industry where compliance, security and data integrity get a lot of scrutiny.

In the end, nothing of the previous solution survived - no code and no infrastructure.

Re:Systems design explains the world: volume 1 by nitrogen on Sunday December 27, 2020 @02:17PM (#25553471)
I have one counterexample but it's a much smaller project: a bespoke ecommerce platform with somewhat tenuous integration into decades-old Oracle EBS backoffice systems was successfully replaced with a heavily customized open source ecommerce platform, with much better backoffice integration.
Re:Systems design explains the world: volume 1 by F_J_H on Monday December 28, 2020 @12:50AM (#25557046)
One thing that changes the calculus, (at least for business applications), is the advent of "low code" platforms, which significantly change the economics.

If you've ever used one, you can see how quickly (and iteratively, which is key) you can spin up new functionality.