|
|
|
|
|
by favorited
473 days ago
|
|
> for instance, Linux handles network socket, special files (like /proc/cpuinfo) or even USB devices as files. This is a powerful idea that can make easy to write or use programs for linux since we can rely in a set of well known operations from this abstraction called file. Benno Rice gave a fantastic talk a few years ago called "What UNIX Cost Us," which he starts off by showing how to write some USB device code in macOS, Windows, and Linux. It only takes a few minutes to demonstrate how pretending that everything is a file can be a pretty poor abstraction, and result in far more confusing code, which is why everyone ends up using libusb instead of sysfs. https://www.youtube.com/watch?v=9-IWMbJXoLM#t=134s |
|
"Everything is a file" is not a bad abstraction for some things. It feels like Linux went the route of a golden hammer here.