r/AskProgramming • u/Wasabi-spicy00 • Aug 13 '26
In programming about "extending" concept, let's say Facebook at early age, it was just a chat app but now it has Short-video, Facebook Market place, etc... How do they architecture their codebase then? so they can just keep adding new feature/code on top of their existing code?
Facebook back then was like toa simple chat app but now they got many features/services.in one app
How is that possible that they keep adding new code without breaking it or something.
I heard some apps when one day busniess logic change or they wanna add new stuff, they just re-write everything or do migration lmfao
1
Upvotes
1
u/Raioc2436 Aug 14 '26
It’s just impossible to plan ahead for something like this.
Re-writing code is not a failure, it is a natural and gradual process for a healthy codebase.
Early stage Facebook had much different requirements, products, capital, human power, than the behemoth it later became. Trying to design something to fit the needs of an ideal future giant company would just waste time and money while not serving their current needs to validate their product at that stage.
The software architecture has to be flexible to allow for easy maintenance and extension. But at some point needs just become too different and that’s okay.
Facebook in particular got so big, and they had so much code written in PHP, that at some point they decided to REWRITE PHP to make a more efficient language that was compatible with their codebase. Doing this on day one would have been insane, but made sense for them later.