logoalt Hacker News

bluGillyesterday at 3:55 PM1 replyview on HN

The protocol is important though, not the internal structure. When you only have exactly one version of a program talking to the same version of itself you don't care. However when you are mixing versions or worse programming language (and thus can't mix structs which are implementation details of your language) the protocol is what matters.

That is if you are worried about doing this by hand reflection is not the answer, something like protobuf where your data structures are generated is the answer.


Replies

gpderettayesterday at 7:39 PM

I completely understand your point. Then again you might be able to use reflection to verify that your manually rolled implementation actually serializes all fields.