# This Place is a Mess, Rewrite Everything!

- Speaker: [Josef Goldstein](/wiki/speakers/josef-goldstein.md)
- Event: [Reversim Summit 2022](/wiki/years/2022.md)
- Video: https://www.youtube.com/watch?v=X3dGfpK8Ey4
- Transcript: [/transcripts/2022/38-X3dGfpK8Ey4.md](/transcripts/2022/38-X3dGfpK8Ey4.md)
- Language: Hebrew · Type: talk · Level: general
- Topics: [Technical Debt](/wiki/topics/technical-debt.md), [Software Engineering](/wiki/topics/software-engineering.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker addresses the common developer impulse to completely rewrite messy legacy code upon joining a new project. The main argument is that developers should resist this knee-jerk reaction, take a deep breath, and first understand the business value and context behind the existing implementation. By thoroughly reading, documenting, and testing the legacy system, developers can build a proper mental model before deciding if and when a rewrite is actually necessary. Ultimately, the audience learns to approach legacy code with empathy and caution, recognizing that all code eventually ages like milk.

## Key points

- [0:11](https://www.youtube.com/watch?v=X3dGfpK8Ey4&t=11s) The speaker introduces the topic by asking the audience how many of them hate legacy code.
- [1:12](https://www.youtube.com/watch?v=X3dGfpK8Ey4&t=72s) Developers often experience a spike of frustration when seeing messy code for the first time, immediately jumping to the conclusion that a total rewrite is needed.
- [3:22](https://www.youtube.com/watch?v=X3dGfpK8Ey4&t=202s) The speaker questions whether the legacy code is actually broken or if it is simply misunderstood, referencing classic software engineering essays on the topic.
- [4:46](https://www.youtube.com/watch?v=X3dGfpK8Ey4&t=286s) The first practical step is to accept ownership of the code and focus on understanding why it was written and what value it delivers.

## Takeaways

- Resist the urge to rewrite legacy code immediately upon encountering it.
- Invest time in reading, documenting, and understanding the business value of existing code.
- Build a mental model of the system using black-box testing and careful refactoring before planning any major changes.

## Questions this talk answers

- How should a developer approach a massive legacy codebase with no documentation?
- When is it genuinely the right time to decide on a full system rewrite?
- How can I build trust and understanding of legacy code safely without breaking production?

## Tags

code quality, legacy code, refactoring, software engineering, technical debt
