Posted by: Anonymous Coward
on June 13, 2005 12:19 AM
Try your numbering sequence as a series of file names under windows. I had someone give me a series of pictures which they had assembled under windows XP with a numbering scheme similer to what you have given. She asked me why they wouldn't stay in the order she wanted them. Basically, windows is just a dumb as linux when it comes to sorting file names. The answer was that she had to insert leading zeros in the number in order to make the file system utilities sort them correctly.
Here are some issues with what you are suggesting. Should 1 + 1 equal 2 or 11? Should 3 * 3 = 9 or should it equal 333? Should 8/4 = 2 or should it be an error? Is 2004-12-17 a date or a mathamatical formula? Lets re-do that as 2004/12/17. How can you tell whether that is a date or if it is a mathamatical sequence? Who knows, maybe it is a file name string and specifies file "17" in folder "12" which is in folder "2004". Any time you try to make a computer guess at the meaning of a data item you are trying to make it read someones mind. It is true that you can come close a lot of times ---- IF you know the context. However, there will always be times when you get it wrong. If the computer does the guessing, then it can be very difficult to get the machine to do what you intended instead of what it thought you intended. As an asside, this is my major complaint about MS Windows and its management philosophy.
You may want to have a look at the IBM iSeries(AS/400 or i5 -- so yes, IBM has gone name crazy too) or something similer. In that environment, you allocate a certain number of digits for a number, and then everything always lines up correctly. Also, in the more recent versions, dates are stored internally as YYYYMMDDHHMMSS and thus always sort correctly reguardless of the formatting given for the display of those dates. With OS/400 and the numbering sequence you listed, I would define the numbers as being, say 9 or 15 digits in length. Then I would define the display of those numbers to be with leading zero suppression and left aligned. They would come out listed in the order you said they should. Because the data items are type identified, a date can be specified as 12-17-2004, Dec, 17 2004, 2004/12/17 or 17 Dec 2004 and all be recognized correctly. But the data type is known, so the user can enter the date in almost any form he/she wants and the computer can recognize it. In other words, data types create a context that the computer can use to interpret what various data items mean. It can then use that context information to present that data back to us in a reasonable way. For example, some of us are used to seeing our dates as Jan. 3, 2001, and others of us are used to seeing them as 3 Jan, 2001. If the computer knows the data type, then it can adjust the display to our preference. If it doesn't know the data type, how can it help us? This is one of the goals of the Reiser 4 file system. OS/400 allows this kind of data type information to be applied to the contents of its files. From what I can tell Reiser 4 will also allow the same type of information to be applied to the file names if you wish. I know that it has been a unixish trait to have the file system store data, and let the applications interpret that data as they see fit. It is also unixish to have scripting languages push that data type definition out to the run time. This has the effect of making the user decide what the data type will be, and the programmer then has to guess what the user will think. It just seems to me that OS/400 and the Reiser 4 file system have gone in the right direction in explicitly telling the computer what the context is for each piece of data, and then let it translate what the user said within that context.