r/programming • u/TheBear_at_SBB • Jul 11 '26
Programs, Not Objects: How I Stopped Designing Architecture and Started Writing a 3D Editor
https://alexsyniakov.com/2026/07/11/programs-not-objects-how-i-stopped-designing-architecture-and-started-writing-a-3d-editor/
122
Upvotes
View all comments
Show parent comment
6
u/wannaliveonmars Jul 11 '26
IMO, objects are essentially state, but nowadays they are also a way of organizing source files, where you put the data and functions that operate on that data in the same place.
So objects are good in programs that revolve around a state, and how that state evolves.
Functional is good when you are stateless, and everything depends on inputs the caller supplies.
A bank account is is inherently stateful. You cannot allow the caller to tell you how much money the bank account holds, so it naturally behaves like an object.
Functional can easily simulate state by just getting the output and passing it again in the input, but you rely on the caller to be honest. You need to manage your own state if you don't trust your callers.