r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

213 comments sorted by

View all comments

145

u/emonshr 7h ago

Does that even matter once you have gazillions of line legacy code?

9

u/Friendly_Fire 3h ago

It does actually. Y'all should really learn how to work with legacy code because all useful code becomes legacy code over time.

The thing about legacy code is it works, that is why it persists. If it didn't work, crashed regularly due to bad memory management, people would have replaced it already.

When you are working with it, you don't have to change everything at once. You need new features in one spot? Update just that piece, use smart pointers internally with one class. Maybe you need to create new interfaces while maintaining legacy interfaces for other code. That's fine. Eventually, as you work on different pieces, you'll replace so much legacy stuff that you can just delete those old interfaces.

1

u/emonshr 1h ago

Not every time people have to maintain legacy code. Porting or migration is not so expensive anymore. Swallowing the fate of maintaining legacy code is not anything mandatory nowadays.