Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    You're describing a distinction without a difference. A file is merely a storage unit, like any other. It's also a semantic unit, like any other. In your example, a file describes a "document" or "chapter." Text editors can store text in files, but they can also store text in databases. Even within the text file, there are semantic units called "words," "paragraphs" and "formatting." So once again, no difference. The only material difference I can think of is that text editors often work with documents "in-memory," but that is not a necessary feature. Commented Apr 7, 2020 at 12:33
  • To me there is a distinction in terms of usability. Let's say I am looking for a specific paragraph in my book. When using raw files, I have to open each file and search for the paragraph in the file. A smart text editor would instead load the whole book and let me search all chapters at once. Or I have to use something like grep, whose main purpose seems to be exactly what I am talking about: Treat a series of files as a single semantic unit and perform an operation (search) on it. Commented Apr 7, 2020 at 13:17
  • Yes, and that smart text editor and grep are still working with files. Commented Apr 7, 2020 at 13:38
  • Maybe the smart text editor can open a single file, multiple files, query a database or call some REST API and makes it look all the same to the user. This was uncommon for applications 20 years ago, but is very common for applications today, especially web apps. This seems like a paradigm shift to me which should have a name. 'Distributed systems' seems close but doesn't quite capture it... Commented Apr 7, 2020 at 13:47
  • What you're describing there is indirection. More specifically, the use of interfaces to promote generalization. For example, most development platforms have the concept of a "file handle" and "read" methods that allow you to read data from that file. But it doesn't have to be a file; it can be any data source beneath that file handle, including a REST interface. The only requirement is that the data source conforms to the expectations of the interface, namely, that it can read data in sequence (and perhaps seek to a location in the "file"), and detect "End of File." Commented Apr 7, 2020 at 13:54