|
|
|
|
|
by hintingonwhoiam
3737 days ago
|
|
Whether you are dealing with OOP, functional, or some other pattern it is always the point to create abstractions which you and others can forget about how they work. Thus m->set_volume(.08) and set_volume(m, .08) should not require you to understand what happens internally as the user of either. More generally in programming that is the point. My only point is that of scope and essentially search space -- set_volume(m, .08) can only access the public interface of "m". While, m->set_volume(.08) could do almost anything to m. In a perfect world, with perfect programmers thinking the same way about what "set_volume" means or should do the separation of state and action would be less valuable. This not to say OOP is > Functional or vice-versa. I think there is a place for both but that is a MUCH larger and more nuanced conversation :) |
|