3 ms·
There is no mention of all the benefits that encapsulation gives us - to take the blogs argument to the extreme imagine writing your own web server, caching lay
by bonobo3000 12y ago
There is no mention of all the benefits that encapsulation gives us - to take the blogs argument to the extreme imagine writing your own web server, caching layer, load balancer, JSON/HTTP parser, frontend logic for every platform, and a hundred other layers of abstraction I may not even know about every time you want to write a blog.
There is a real tradeoff between programmer productivity and resource usage, because every library that isn't tailored for your exact use case (i.e every library) is an inefficiency. Given programmers wages vs. cost of CPU/RAM/storage, and the long term trends (technology makes one cost lower, the other cost higher!), it is economically insane to reject encapsulation.
I definitely see the appeal viewing programming as craft. In that case, its no coincidence that "reinventing wheels" is good advice to learn how to program. Its just not how to run a business.
- mattdw 12y agoPerhaps, though, computing resources are priced artificially low due to externalities (e.g. third world wage inequality, environmental impact not paid for), and perhaps a sane long-term approach would find a different balance between programmer wages and physical tech components.
- AnthonyMouse 12y agoMoore's law eats the difference between first world prices and third world prices for breakfast. Changing how the hardware is manufactured wouldn't materially affect the choices programmers make even if it doubled the hardware cost, and it probably wouldn't even do that.
- userbinator 12y agoto take the blogs argument to the extreme imagine writing your own web server, caching layer, load balancer, JSON/HTTP parser, frontend logic for every platform, and a hundred other layers of abstraction I may not even know about every time you want to write a blog. I see the argument as saying that all those layers are not really necessary. Take HTTP for example: it's a large complex protocol that requires plenty of code to handle correctly (e.g. the size of a request, and the various pieces inside it, are not specified and the parser has to read through the whole request sequentially to figure this out), and the majority of applications using it never need the full functionality. What if it was a simpler, easier-to-parse format that was as extensible? One of the points I get from his argument is that encapsulation has encouraged us to build massively overcomplicated systems by piling layers upon layers with little understanding of how everything fits together, when we could instead be building much simpler and more efficient systems that could still be using abstraction but in a far more cautious manner.
- crpatino 12y agoI think you are partially right, but the situation (I'd rather not label it as a problem just yet) goes on many levels. By example, Moore Law has allowed us to pack incredibly large amounts to transistors in reasonably affordable machines, and what we do is... virtualization, a.k.a. write software that (presumably) simulates being a (much slower and limited) hardware system so a third party can run other programs on top of it, for a fee. That kind of makes economic sense (because customers have a big appetite for computing power... just as long as they do not have to keep those pesky sysadmins on the payroll), but from a purely technological point of view is craziness. Every component you add into your stack is a potential source of error, and you do not gain any extra features because you are simulating real hardware... so, why to do it in the first place? I think the answer is: because nobody would buy all those transistors if we didn't do so.
- marcosdumay 12y agoAnother, possible answer is: Because transistors are really cheap, and energy only a bit expensive. But that wasting saves competent people time, what's a very expensive and limited resoure. Why does everybody ignore the obvious explanation, that you'd get from the mouth of any participant, for a convoluted one that only fits the criterium of political correctness?
- crpatino 12y agoI do not think anything you say here contradicts what I originally said. Yes, there are economic reasons why this makes sense, probably having to do with labor compensation. Having said that, please excuse my ignorance on system administration but, how does running a virtual machine that pretends to be a Linux/x64 box... on top of a real Linux/x64 box saves anybody at least some time? As a software developer who drank the Java kool-aid back in the 90, at least the "write once, run everywhere" mantra did make some kind of sense in those terms, but this other example is genuinely beyond me. To me it has more to do with a tech company being able to put together an A-class team to serve a large number of customers that would not stand to pay the salary of a single full-time B-level IT guy if their business model depended on it.