And what if you detect said corruption? Then what? Your parser can no longer read a single entry in the file, and you have to discard the whole thing. That's too fragile for the real world.
It's much easier to SEE said corruption with XML than using invisible line characters. Not to mention portability between different systems.
They are well-formed XML documents. Get over it. The transparency of XML across other mediums makes it stomp all over yaml. The use of DTDs, namespaces, etc., make it a guarantee that XML will only be expanding.
Different kinds of syntax suit different kinds of files better. Horses for courses.
How far should we go for the sake of unity of syntax across all filetypes? Should Java source files be done in XML too? I'm sure a DTD or Schema could be made for that, but it would be much harder to read. Likewise a simple config file is made much harder to read by changing it to XML.
@ dr_lha: so I can control UID & GID, etc., on 10.5 without running Mac OS X Server?
I believe so, although I have not used Leopard yet to see how this works, but what I read online implies that going to the Users Preference Pane and right clicking on a user will allow you to edit the "Advanced" stuff.
What I don't know right now is where Leopard actually stores this information. It used to be in NetInfo, is it now in a standard text file or something else?
Different kinds of syntax suit different kinds of files better. Horses for courses.
How far should we go for the sake of unity of syntax across all filetypes? Should Java source files be done in XML too? I'm sure a DTD or Schema could be made for that, but it would be much harder to read. Likewise a simple config file is made much harder to read by changing it to XML.
This is a different story here. A compiler pre-formats the files before they are compiled. Ttakes out all whitespace, end lines, etc. Then starts compiling and converting to machine code / assembly.
Here is an example of preferences within preferences in ascii:
- item1
- item1
- item2
- item3
- item2
- item3
And how do you represent binary data with this scheme? It seems to me like one misplaced indent could corrupt this file too.
ascii, using simple text files is just not practical for anything but the most basic preferences. And besides, why are you hand-editing preference files. How are they becoming corrupted? If you software isn't managing this for you, then you aren't finished developing your application.
I understand people need to trash preference files to debug sometimes, but this isn't because they've corrupted the data or the format of the file, it's because the app allowed itself to save incorrect data in the file.
And how do you represent binary data with this scheme? It seems to me like one misplaced indent could corrupt this file too.
It doesn't make the whole file unreadable though. The program can still read the file and choose to ignore the nonsense data and recover else it can. In the case on XML the parser will simply refuse to read any of it, thus reducing the programmers options.
It doesn't make the whole file unreadable though. The program can still read the file and choose to ignore the nonsense data and recover else it can. In the case on XML the parser will simply refuse to read any of it, thus reducing the programmers options.
That isn't true. The XML parsers that Apple has built works the same as HTML parsers. If there is a missing > or w/e, it ignores it and continues reading "what it can".
However, both sides can become seriously corrupt, more so a file with invisible formatting. ESPECIALLY BEING TRANSFERRED BETWEEN SYSTEMS. That is the biggest problem (imo) with your proposed method. Not all systems use the same invisible ascii for endlines, tabs, spaces, etc.
Is it really that big of a deal to have it in XML? You could have it be like M$ and have it be in an .ini file. Have fun editing that format universally.
How is the parental controls different from what Tiger has?
I just want to agree here, I was excited to read this article for one thing, the parental control differences, but my daughter's been using the exact same parental controls for 2 years now with Tiger. You'd think for all this research, the writer could have looked at Tiger too?
I just want to agree here, I was excited to read this article for one thing, the parental control differences, but my daughter's been using the exact same parental controls for 2 years now with Tiger. You'd think for all this research, the writer could have looked at Tiger too?
My wife's considering moving to a managed account so the computer can tell her when to get off the damn net and go to bed... (at some time before 2 AM). \
Not sure why they don't market parental controls in parenting magazines and similar media.
Seems like a fine feature for that crowd, doesn't it?
I think it is because they already had it in Tiger just no one used it. It seems like a fair amount of the features they are advertising as new are just small improvements. It doesn't seem like anyone knows what the difference between parental controls is in Tiger vs Leopard.
ESPECIALLY BEING TRANSFERRED BETWEEN SYSTEMS. That is the biggest problem (imo) with your proposed method. Not all systems use the same invisible ascii for endlines, tabs, spaces, etc.
What other systems do plan on transferring your Mac OS X config files to?
I transfer my home folder between windows and mac... for back up purposes. For instance, on my hack I did something dumb and reset my computer during os x booting a few times... and eventually the drive failed to boot os x. So I had to boot into windows and transfer the home folder to windows to back everything up. If all those config files were purely ascii formatted, who knows what would have happened.
Nothing would have happened unless you opened them in Notepad on Windows and started editing them.
Not exactly, just copying them across the network can screw them up, even if they had .txt extension but especially if they don't have an extension at all. I did make a similar point earlier about preferring xml, but I don't really feel as strongly about config files as I do about other text file issues. For example httpd.conf on any unix system is straight text. You are not supposed to copy it or email it anywhere so I guess it is ok as ascii.
true but why should something be so volitile and platform dependent?
Platform indepedence is not a needed feature of Mac OS X config files. They're *Mac OS X* config files. It's like accusing a motor car of being "volatile and platform independent" because it doesn't work in outer space. So what? You don't use a car in outer space. And you don't use OS X config files on other systems.
Comments
And what if you detect said corruption? Then what? Your parser can no longer read a single entry in the file, and you have to discard the whole thing. That's too fragile for the real world.
It's much easier to SEE said corruption with XML than using invisible line characters. Not to mention portability between different systems.
They are well-formed XML documents. Get over it. The transparency of XML across other mediums makes it stomp all over yaml. The use of DTDs, namespaces, etc., make it a guarantee that XML will only be expanding.
Different kinds of syntax suit different kinds of files better. Horses for courses.
How far should we go for the sake of unity of syntax across all filetypes? Should Java source files be done in XML too? I'm sure a DTD or Schema could be made for that, but it would be much harder to read. Likewise a simple config file is made much harder to read by changing it to XML.
It's much easier to SEE said corruption with XML than using invisible line characters. Not to mention portability between different systems.
And how are you going to see the corruption if your XML tool refuses to load the file in the first place because it's non well-formed?
I thought we weren't supposed to use non-XML tools to edit XML files.
Great Articles!
Keep them comming!
Agreed, I want the whole lot as a book to re read later
@ dr_lha: so I can control UID & GID, etc., on 10.5 without running Mac OS X Server?
I believe so, although I have not used Leopard yet to see how this works, but what I read online implies that going to the Users Preference Pane and right clicking on a user will allow you to edit the "Advanced" stuff.
What I don't know right now is where Leopard actually stores this information. It used to be in NetInfo, is it now in a standard text file or something else?
And how are you going to see the corruption if your XML tool refuses to load the file in the first place because it's non well-formed?
I thought we weren't supposed to use non-XML tools to edit XML files.
I never suggested that... others did.
But if you DO use those tools, your file won't be corrupted in the first place.
Different kinds of syntax suit different kinds of files better. Horses for courses.
How far should we go for the sake of unity of syntax across all filetypes? Should Java source files be done in XML too? I'm sure a DTD or Schema could be made for that, but it would be much harder to read. Likewise a simple config file is made much harder to read by changing it to XML.
This is a different story here. A compiler pre-formats the files before they are compiled. Ttakes out all whitespace, end lines, etc. Then starts compiling and converting to machine code / assembly.
Here is an example of preferences within preferences in ascii:
- item1 - item2
- item3
And how do you represent binary data with this scheme? It seems to me like one misplaced indent could corrupt this file too.
ascii, using simple text files is just not practical for anything but the most basic preferences. And besides, why are you hand-editing preference files. How are they becoming corrupted? If you software isn't managing this for you, then you aren't finished developing your application.
I understand people need to trash preference files to debug sometimes, but this isn't because they've corrupted the data or the format of the file, it's because the app allowed itself to save incorrect data in the file.
And how do you represent binary data with this scheme? It seems to me like one misplaced indent could corrupt this file too.
It doesn't make the whole file unreadable though. The program can still read the file and choose to ignore the nonsense data and recover else it can. In the case on XML the parser will simply refuse to read any of it, thus reducing the programmers options.
It doesn't make the whole file unreadable though. The program can still read the file and choose to ignore the nonsense data and recover else it can. In the case on XML the parser will simply refuse to read any of it, thus reducing the programmers options.
That isn't true. The XML parsers that Apple has built works the same as HTML parsers. If there is a missing > or w/e, it ignores it and continues reading "what it can".
However, both sides can become seriously corrupt, more so a file with invisible formatting. ESPECIALLY BEING TRANSFERRED BETWEEN SYSTEMS. That is the biggest problem (imo) with your proposed method. Not all systems use the same invisible ascii for endlines, tabs, spaces, etc.
Is it really that big of a deal to have it in XML? You could have it be like M$ and have it be in an .ini file. Have fun editing that format universally.
How is the parental controls different from what Tiger has?
I just want to agree here, I was excited to read this article for one thing, the parental control differences, but my daughter's been using the exact same parental controls for 2 years now with Tiger. You'd think for all this research, the writer could have looked at Tiger too?
Seems like a fine feature for that crowd, doesn't it?
I just want to agree here, I was excited to read this article for one thing, the parental control differences, but my daughter's been using the exact same parental controls for 2 years now with Tiger. You'd think for all this research, the writer could have looked at Tiger too?
The times of use, and bedtimes part is new. And the logging part. This bits they advertise on the page really: http://www.apple.com/macosx/features...lcontrols.html
My wife's considering moving to a managed account so the computer can tell her when to get off the damn net and go to bed... (at some time before 2 AM). \
Cheers,
Martin.
Not sure why they don't market parental controls in parenting magazines and similar media.
Seems like a fine feature for that crowd, doesn't it?
I think it is because they already had it in Tiger just no one used it. It seems like a fair amount of the features they are advertising as new are just small improvements. It doesn't seem like anyone knows what the difference between parental controls is in Tiger vs Leopard.
ESPECIALLY BEING TRANSFERRED BETWEEN SYSTEMS. That is the biggest problem (imo) with your proposed method. Not all systems use the same invisible ascii for endlines, tabs, spaces, etc.
What other systems do plan on transferring your Mac OS X config files to?
If all those config files were purely ascii formatted, who knows what would have happened.
Nothing would have happened unless you opened them in Notepad on Windows and started editing them.
Nothing would have happened unless you opened them in Notepad on Windows and started editing them.
true but why should something be so volitile and platform dependent?
Nothing would have happened unless you opened them in Notepad on Windows and started editing them.
Not exactly, just copying them across the network can screw them up, even if they had .txt extension but especially if they don't have an extension at all. I did make a similar point earlier about preferring xml, but I don't really feel as strongly about config files as I do about other text file issues. For example httpd.conf on any unix system is straight text. You are not supposed to copy it or email it anywhere so I guess it is ok as ascii.
true but why should something be so volitile and platform dependent?
Platform indepedence is not a needed feature of Mac OS X config files. They're *Mac OS X* config files. It's like accusing a motor car of being "volatile and platform independent" because it doesn't work in outer space. So what? You don't use a car in outer space. And you don't use OS X config files on other systems.