Live data from Hacker News

Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

plus.google.com

41–50 of 265 posts

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#41
What I like is the "I dont start prototyping till I have a good mental picture"

I am currently stuck on a project I want to start becasue I cannot get it to fit right in my (future) head. And I am glad I am not an idiot for not being able to knock out my next great project in between lattes.

(Ok, in direct comparison terms I am an idiot, but at least its not compounded)

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#42

Earlier quoted context omitted.

How is YAML a superset of JSON? Do you mean 'conceptually'?

To be specific, JSON syntax is a subset of YAML version 1.2. However, I hate YAML with a passion. It is worse than XML in my books. I can usually read JSON fine. I can also read XML in many cases. For the life of me, I just can't read YAML. It has something to do with "-", line indentation and different ways of writing lists. Of course, someone will say YAML is technically better ...

Different for me, i would prefer YAML over XML or JSON

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#43
post #15

What'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…

XML is unnecessarily verbose, for the supposed sake of human readability. But used as a serialization format, it isn't really readable or editable by humans (except in the sense that a Turing machine is programmable): remember that the ML in XML stands for "markup language", and SGML, its predecessor, was designed as a way of marking up normal text, not littering data with angular brackets and identifiers. (XML/SGML arguably isn't that hot as a markup language, either.)

If you really need a hierarchical serialization format that is "verified for validity and syntax", the problem is that XML has prevented the adoption of something better (because it was "good enough").

If you don't need that, then XML is overkill and bloat and makes your format less readable than it could be. And you rarely need it, because either your data is computer-generated and -read, so there's little point in putting in extra schema checks, or schema verification is woefully insufficient (because it can't verify the contents of fields, relations between fields, or a ton of other stuff that can accidentally go wrong).

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#44
post #15

What'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…

I personally miss having schemas and XSLT in JSON.

> doing everything in XML is a stupid idea (e.g. XSLT and Ant)

XSLT actually made a lot of sense. If everyone writes code to transform format1 to format2 then what you end up with a lot of slightly different transformations. Its main downfall, just like XML itself, was that it was annoying and time consuming to write.

How would you replace all this if you moved away from XML?

http://git.hohndel.org/?p=subsurface.git;a=tree;f=xslt;hb=HE...

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#45
post #13

I think this title is wrong. Firstly some clarification - this appears to just be about the persistence format for his dive log. It was XML, now it's git based with plain text. As someone who had to manage a system which worked with plain text files structured in a filesystem for a number of years in the 1990s, this is done to death already. You now end up with the following problems: locking, synchronising filesyste…

The impression I got was that he was going to store his data in a git object database and that the files would be virtual in there. It would be like the .git directory without the working files on disk. It's all just conjecture until his code his out.

Regardless, I would think that some applications are simple enough (store few enough separate objects in the file system) that the issues you cite are not likely to cause a problem.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#46

Earlier quoted context omitted.

For those who missed it, here's what Linus wrote in the comments: "+Aaron Traas no, XML isn't even good for document markup. Use 'asciidoc' for document markup. Really. It's actually readable by humans, and easier to parse and way more flexible than XML. XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horribl…

Use 'asciidoc' for document markup. I just had a quick scan of the user guide. It's very impressive. Looks like markdown but with all the edge cases thought out.

I've been working with restructured Text a lot, it's a breeze as well. Seems quite similar.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#47
post #23

Earlier quoted context omitted.

And it doesn't support the multitude of accurate numeric types that XML does implicitly. XML data is not just "strings", it's a sequence of characters. The deserializer determines what sort of type it is based on either the structure or the language's capabilities. With XML, you can define these policies. With JSON you're stuck with JavaScript being the semantic standard and type definitions which ties you to floats…

How so? XML by itself only supports strings; any other data types have to be derived from a schema. But you can do the same with any other format that supports strings, including JSON.

But in the design of XML this was already acknowledged.

That's why there is the distinction between well-formed and valid XML documents. Only with valid XML documents there is a schema attached that will describe these nodes with the type attribute. And because it is extendable, these types can be anything but they will be automatically validated by the parser.

JSON OTOH doesn't have this extensibility. There are a couple of predefined types but if you need to go beyond them (and this happens all the time because JSON doesn't even define a date type!) any interpretation is up to the parsing program and this can vary tremendously (again, look at the handling of dates and for example the questions on stackoverflow about them).

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#48
post #29

> "I actually want to have a good mental picture of what I'm doing before I start prototyping. And while I had a high-level notion of what I wanted, I didn't have enough of a idea of the details to really start coding." This I like. The race away from the waterfall straw man has also stripped us of the advantages of BDUF. While rigid phase-driven project management helps nobody, I think there's still room for speccin…

You should be speccing what you want to achieve: the goals, the why, the impact, the external limitations, measures of success and so forth. This also allows you to describe and plan testing up front. The "how" is best handled in an iterative manner. A lot of people use AGILE to avoid planning at all, which is a particular destructive anti-pattern, and the exact opposite of what you need.

> "A lot of people use AGILE to avoid planning at all"

Yup, I've seen this a lot.

In one instance "Agile" meant I could finish a major task using an unfamiliar language, framework and code base in short order.

Genuinely, the customer was told "Of course, fuzzix here is familiar with Agile processes so you should have this in 3 weeks".

edit of course this also meant there was no formal spec for the task, though I did have a photo of the whiteboard.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#50

I don't quite get Linus' problem with XML for document markup (for anything else - config files, build scripts - sure, XML is horrible). Does anyone know any more details about what his specific gripe is? For me, asciidoc (which looks very similar, conceptually, to markdown) suffers from one huge problem: it's incomplete. Substituting symbols for words results in a more limited vocabulary, if that vocabulary is to re…

Document markup is the one place XML is a no-brainer - more specifically, long-form, highly structured documents (i.e., essentially books).

Without it, publishing would be stuck in a morass of nebulous, ill-documented proprietary messes, and a great deal of current learning would be at risk of being lost to posterity. The fact that there are associated open standards such as XSLT with which to transform it is just the icing on the cake as far as publishing is concerned.

This is why there's so much distaste for XML - people try to use it for applications where it isn't ideal (and there are many more of those than there are applications where it is ideal) because they've swallowed someone else's hype, and as a consequence they have a bad time. If not for the unbelievable exaggeration a few years back (I heard people claim without irony that XML - a markup language for god's sake - would literally change the world), the divisiveness wouldn't exist, and it would be a technology used by experts quietly getting on with the jobs it's best for.

Post reply on HN