2 ms·
>Encapsulation. High-quality code is most often made up of self-contained components: one cannot change the behavior of a self-contained component by modifying
by DeathArrow 5y ago
>Encapsulation. High-quality code is most often made up of self-contained components: one cannot change the behavior of a self-contained component by modifying something outside of it, nor does the component modify things that are external to it (within reason—it makes sense for a component to read and update a database if that’s understood to be its job). This saves development time because when a component needs to be fixed, updated, or deleted, programmers spend less time searching for external causes and effects.
I am ok with it only if it doesn't mean "encapsulation in an OOP way" which means hiding state in many different places which leads to complexity.