views:

82

answers:

2

I'm interested to see who favours more obscure data serialisation formats over the more obvious ones (JSON, XML and Yaml). What do you tend to use? What syntax do you prefer?

+3  A: 

It really depends on the requirements:

  • Do you need portability? If so, between which platforms?
  • Is speed more important than size, or vice versa?
  • Is it important to use some sort of international standard container format (such as XML, even if the details aren't standardised)?
  • What sort of backward/forward compatibility do you need?

Personally I'm a fan of Protocol Buffers, but then I'm biased as not only a Google employee, but one who's ported PB to C#...

Jon Skeet
A: 

Some are very fond of ASN.1 (you know who you are).

It is less human readable than XML, but more compact.

An example, after bit-encoding:

30 13 02 01 05 16 0e 41  6e 79 62 6f 64 79

This assumes the sender and receiver already knows about the structure of the data.

(Before bit-encoding it is:

myQuestion FooQuestion ::= {
    trackingNumber     5,
    question           "Anybody there?"
}

)

Peter Mortensen