3 ms·
> Mathematics is essentially a system for "encapsulating internal complexity" Not really; here's why: An index is something that maps a small space into a bi
by noblethrasher 11y ago
> Mathematics is essentially a system for "encapsulating internal complexity"
Not really; here's why:
An index is something that maps a small space into a big one so that you can move through the big one by traversing the small one. Example: The old card catalog is a tiny space through which you can move relatively quickly so that you don't have to explore parts of the library through which you can only move relatively slowly.
Mathematics is an indexing system for ideals (it maps ideals onto ideals). It's unreasonably effective for a couple of reasons:
* Some ideals correspond close enough to reality to be useful. So, mathematics indexes reality.
* Since mathematics indexes ideals, it can index itself. In other words, no matter how big mathematics gets, you can always shrink it again by using more math.
The purpose of encapsulation is to hide, but the purpose of indexing is to reveal. Mathematics does the opposite of encapsulation.
> In programming, the core abstraction mechanism is the function, which is essentially a device for "encapsulating internal complexity"
Abstraction is not about hiding complexity, abstraction is just naming things. I think what you really mean to say is that the core abstraction in programming is substitution: We give names to substitutions. (As a side note, it's an unfortunate misconception that software must have complexity which must then be hidden)
> Remove mutable state and OOP reduces to "partially applied functions" in the mathematical sense, i.e. zero original content.
Remove mutable state and de facto OOP reduces de jure OOP, which reduces to "networks of general purpose computers that get things done by sending and interpreting messages". We have at least one big existence proof that this works at scale.
But, even in the mathematical sense, OOP with immutability offers more than just partial function application; it yields families of algebras, and we're always inventing/discovering new varieties of those. On the other hand, if you use just a little bit of mutable state judiciously, you get a set of propositions that are falsifiable by experiment: In other words, you get science, which was one of the motives for inventing OOP.
- pacala 11y agoGreat points all around, thanks for the reply. Mathematics encapsulates at proof level. I don't have to care how Pythagoras's theorem may be proven, I know it holds for every right triangle and I can build from there. It's a device for encapsulating the proof state space search, saving time when building more complex theories. Re: abstraction, with any name [function] comes a set of properties we know they are true, either explicitly specified or implicitly derived from common sense logic. I don't have to care how the sort function is implemented, I only have to know that given an input, it produces an output in a certain relation with the input. From there, I can build more complex programs faster than if I had to write the sort function myself. Once there are functions with a specification, logically speaking one can freely substitute one for another, as long as the specs are in the correct logical implication relation. Excuse me if I'm a bit baffled of what exactly the intellectual content of OOP is.