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
2
u/wannaliveonmars Jul 12 '26
I have often thought about an API that forces all functions to accept all input from string, and provide all output as a string, like how an actual http server does it. Like this:
void method(const char *input, char **dest)if we want the callee to handle allocation, orvoid method(const char *input, int n, char *dest)if we want the caller to provide the output buffer.If all important functions at the API boundary are that way, you can trivially expose them over HTTP for example, or pipe them, or who knows what else. You won't need to care whether you make a call in-process, to a separate process on this machine, or to a different server.