Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: OneWingedShark
The “everything is a file” mindset is horrible; your monitor is not a file, nor is your hard-disk.

"Everything is a file" is great because it makes it easy for us programmers to do anything. Need to write to a device? Just write to its file. Apple just did well in hiding that strange concept from users.

90 posted on 05/27/2009 6:20:18 AM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 30 | View Replies ]


To: antiRepublicrat

>>The “everything is a file” mindset is horrible; your monitor is not a file, nor is your hard-disk.
>
>”Everything is a file” is great because it makes it easy for us programmers to do anything. Need to write to a device? Just write to its file. Apple just did well in hiding that strange concept from users.

That’s like saying Assembler is great because it allows you to do ANYTHING the computer CAN do... it is true; however, it does not disallow things that should NOT be done, nor does it generally help the programmer. A good example of things that CAN be done that shouldn’t be done can be found in C/C++ and is one ‘feature’ of being able to use an assignment inside the condition-test of a control structure like IF.

A better design, IMO, would be to use the OOP paradigm of thought where “things are objects” (single-ancestor object) & then have a base-class wherein the object ‘knows’ how to write itself to a stream and another method for receiving an object from a stream and use those. A slight abstraction of the general concept, but somewhat better. Personally though, I would tend towards a model wherein a device is represented/interfaced by an object with, as an example, a ‘geneology’ of something like TObject -> TSystemObject -> TDevice -> TOutputDevice -> TMonitor [-> TSpecificMonitor]. {IE something similar design-concept wise to Borland’s old TVision API or their [newer] VCL.}

What I’m getting at is that just because you CAN do something with one mode-of-thought does not mean that mode of thought is well-suited to the problem at hand. Take, for instance, the problem of the relationship between the hands of an analog-clock (suppose you wanted to find how-often and when/where they were pointing in the same direction). Intuitively you immediately see that 24 is the correct number and that 12:00 and 6:00 am&pm are ‘zeroes’ [solutions] in your problem. Expressing this in the x/y Cartesian Plane is doable, but it results in unnecessary effort; a more elegant solution would be to use polar-coordinates, it is a different mode-of-thought but perfectly suited for thinking about this problem.


93 posted on 05/27/2009 7:35:58 AM PDT by OneWingedShark (Q: Why am I here? A: To do Justly, to love mercy, and to walk humbly with my God.)
[ Post Reply | Private Reply | To 90 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson