Open aparcar opened 5 years ago
I am not sure about this. Before this change, the library is just very opinionated about how things are encoded and decoded. The format is static all the way, which makes it very simple and also very small. Proto is on the other side, where it allows for very dynamic changes at the expense of a few bytes that define the notion of "fields" and allows for depreciation, etc. The change in this pull request is a mixture of both, but not backwards compatible and only forward compatible with extending the library each time (because new opcodes will need to be introduced). Extending the library won't scale, because some people need X, some Y and some Z, which means at the end, the library has opcode X, opcode Y and opcode Z. WDYT?
This is more like a POC or an idea on how it could be implemented. I think this approach is far easier than using protobuf, at least for the scenarios I'm looking into.
Please be aware I never touched any cpp before, highly likely it's the worst possible style :roll_eyes:
Signed-off-by: Paul Spooren mail@aparcar.org