Answer to: How does 'everything is a file' not contradict 'do one thing and do it well'?
Score: 2
Not only there is no contradiction—both go the same way.
“Do one thing and do it well” encourages composition over monolith. For instance, instead of having one huge application that makes it possible to create videos and also encode them and handle all sort of video devices such as video cameras, one could have a GUI for creating videos, and this GUI will rely on a separate program that deals exclusively with video encoding, and a separate program that handles devices and presents a video camera as a stream—in other words, a file.
The benefits of such approach:
Programs are smaller, and therefore easier to maintain.
A user may only be interested by video encoding. No need to install the whole monolith to do just that.
Parts of the system can easily be swapped, and alternatives can be created more easily than when trying to create the whole monolith.
“Everything is a file” is a convenient way to achieve “do one thing and do it well.” Think of it as a standard.
Consider electricity at home. In your country, there is very likely a standard for wall sockets. In a socket, you can plug your PC, or a phone charger, or a desk lamp, or a vacuum cleaner.
Does the fact that one socket supporting all those appliances mean that it's doing too many things? Well, not really. It does one and one only thing: it powers stuff you plug in it. If there were separate plugs for vacuum cleaners (preferably each manufacturer would have its own “standard”) and other ones for your PC (Dell PCs won't go in sockets designed for HP!) and different ones for chargers, and then there would be ones for CFL and ones for Osram LEDs, and ones for Philips LEDs... each socket won't do less compared to a standardized one. It would have the exact same role.
Same here. A file is just a standard by which components of a system may interoperate.
View Question ↗
Question
Parent Entity
Score: 4 • Views: 77
Site: softwareengineering
SaaS Metrics