struct Codec
{
*int (*encode)(*int);
*int (*decode)(*int);
};
he probably meant to swap the int and the asterisk to mean a pointer to int. But no one would use a pointer to int to mean bytes; we have pointer to char or pointer to unsigned char for that: struct Codec {
uint8_t* (*encode)(uint8_t*);
uint8_t* (*decode)(uint8_t*);
};
And that doesn't exactly deal with ownership issues.But besides those nitpicking, I struggle to see what his point is. His point is to extract common features of components and build interfaces for them? I mean isn't that something we've been doing for a long time?