| ▲ | deterministic a day ago | |
Merging data and behaviour into a single unit (the core idea behind OOP) is literally impossible to do in practice. Just imagine "sending a message to an int to send a copy of itself to a HTTP server" or "send a message to an array of colors to raytrace itself" or "send a message to a file asking it to sort itself and render itself in 3D". The problem is that everything will literally end up depending on everything. A perfect implementation of the ultimate spaghetti code. In contrast, split the code into Data, Dumper, Reader, Writer, Verifier, Renderer, Editor etc. modules (or classes used as modules) and the code is simple to understand with zero circular dependencies. And it works for any language including non-OO languages. | ||