3 ms·
Did you mean _encapsulation_? React and Django are not black boxes. The source is all there, and their interfaces often reflect their internal workings. You kn
by alganet 2y ago
Did you mean _encapsulation_?
React and Django are not black boxes. The source is all there, and their interfaces often reflect their internal workings. You know the insides but you are not meant to poke around.
- Suppafly 2y agoEven if the source is all there, it's not like you are really looking at it. Functionally it's same as a black box if you treat it that way.
- alganet 2y agoIt's not just about the source. Frameworks are leaky abstractions by design, they intentionally expose their internals. In Django, for example, you are supposed to know what kind of queries it generates. It is documented how queries are generated (an exposed internal). You have to open it to configure it: DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", } } And by doing so, you have to acknowledge (in this case) that postgres becomes a known component of the "insides" (even though you are supposed to only interact with the ORM). A black box doesn't need this kind of stuff. It would have an embedded database instead. Like a plane black box would have its own batteries instead of relying on the plane power supply. This is all good, I'm all in favor of good clear boundaries between components. The existence of a boundary does not make it a black box though. That's why I would prefer using the term "encapsulation" when describing the advantages of having an abstraction.