Earlier quoted context omitted.
This is a good point, but I feel that discouraging this type of approach is not the way to go. I apologise in advance for ranting... I hope this is not too off-topic, but instead a "zoom out" on the issue. This touches on something deep and wrong about how we use computers these days. Computers are really good at being computers, and the amplification of intellectual capabilities they afford is tremendous, but this i…
In a world where users will willingly enter malicious code into their computers if they believe it will do something they want[1], can there really be a better way? [1] https://www.facebook.com/selfxss
Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
181–190 of 265 posts
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#182What's with all the XML hate? Of course, doing everything in XML is a stupid idea (e.g. XSLT and Ant) and thanks heaven that hype is over. But if I want something that is able to express data structures customized by myself, usually with hierarchical data that can be verified for validity and syntax (XML Schemas or old-school DTD), what other options are there? Doing hierarchical data in SQL is a bitch and if you wan…
The likelihood of a JSON feature biting you in the ass like that is far lower. Don't use XML until you actually need something XML SPECIFICALLY provides.
Also JSON easily translates with easy to work with dictionaries and lists, XML parsers take more code to work with equivalent items.
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#183Earlier quoted context omitted.
One of the core aspects of XML that is really important is that no typing is inferred by the structure of the file unlike JSON. JSON is by nature tied to the JavaScript type system which is sparse and inaccurate. For example, if you look at the following: { "name": "bob", "salary": 1e999 } Ah crap! Deserializer blew (in most cases silently converting the number to null) bob 1e999 No problem. The consumer can throw th…
> Ah crap! Deserializer blew (in most cases silently converting the number to null) Right -- the parser blew it. That many implementations do this is frustrating (and caused me so many problems that I ended up building my own validator for problems like this: http://mattfenwick.github.io/Miscue-js/ ). JSON doesn't set limits on number size. From RFC 4627: An implementation may set limits on the range of numbers. It's…
[1] http://www.tbray.org/ongoing/When/201x/2014/03/05/RFC7159-JS...
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#184Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#185Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#186Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#187Why reinvent on-disk data formats when you can just make a file of protocol buffers? https://code.google.com/p/protobuf/
(other than that I agree it's a good solution)
Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#188Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#189Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”
#190Earlier quoted context omitted.
You probably know this, but remember that storing user data as code is a place where you (general "you") have to think very carefully about security. Is there any way that arbitrary code in the file could compromise the user's system? If so, does the user know to treat these data files as executables? Is there any way someone untrusted could ever edit the file without the user's knowledge? Even in combination with ot…
This is a good point, but I feel that discouraging this type of approach is not the way to go. I apologise in advance for ranting... I hope this is not too off-topic, but instead a "zoom out" on the issue. This touches on something deep and wrong about how we use computers these days. Computers are really good at being computers, and the amplification of intellectual capabilities they afford is tremendous, but this i…
Learning to swim is not done by throwing a kid in the deep end of a pool. Learning to code is not done by encouraging bad security practices.