[Interest] Current QDataStream format documentation?

Ch'Gans chgans at gna.org
Sun Sep 25 03:31:48 CEST 2016


On 25 September 2016 at 10:38, Giuseppe D'Angelo
<giuseppe.dangelo at kdab.com> wrote:
> Hi,
>
> Il 24/09/2016 02:50, Ch'Gans ha scritto:
>> Adding my 2 cents, I haven't use QDataStream stream much, yet i'm very
>> well aware of this restriction. I think the documentation is very
>> explicit about this. And that might be the reason i haven't use it
>> much.
>
> I'm actually arguing that there's no such restriction. The format used
> on the wire is documented (poorly, see my other email), which means we
> can never change it.
>
>> QDataStream is black-box system for Qt to Qt exchange.
>
> The mere fact that such documentation exists contradicts this fact.
> Plus, QDataStream's own documentation does not say anything like that
> (at least, I can't find it. I'll be happily to be disproven)

Rational is quite simple, if i need a well documented exchange format,
then i don't try to use a poorly documented one!
I've always considered QDataStream a convenience persistent storage
class for Qt application, not for exchange with "foreign" code. Same
goes with QSettings, it hasn't been designed as an exchange file
format, so i don't try to use it for that purpose.

>
>> If the other side of the pipe is arduino, maybe try to use JSON (very
>> easy to use on Qt side), and i'm sure arduino as some library for
>> this.
>
> ... and add a gigantic overhead for JSON's (de)serialization. Seems like
> a terrible idea. You still want some sort of binary format.

"Gigantic"? That's sounds very much speculative... They run HTTP
servers over TCP/IP  on arduino (just a random example).

Yes JSON will add some overhead, as Thiago pointed out, CBOR [1] can
be an alternative.
And since we seem to be into premature optimisation, then let's roll
your own, go for ASN.1 with PER [2], very compact indeed, but you'll
have to deal with code complexity, both on Arduino and in Qt...

JSON could still be a valid alternative, if Arduino has a
ready-and-easy to use library, and the data exchange is not crazy (how
many records/bytes per seconds are we talking?).
What's more important here? dev time, CPU overhead, wire overhead,
standard format? ...

Chris

[1] http://cbor.io/
[2] https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One


>
> Cheers,
> --
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
> KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
> KDAB - Qt, C++ and OpenGL Experts
>



More information about the Interest mailing list