<story><title>Good Code Design from Linux</title><url>https://leandromoreira.com.br/2019/08/02/linux-ffmpeg-source-internals-a-good-software-design/</url></story><parent_chain></parent_chain><comment><author>kccqzy</author><text>Doesn&amp;#x27;t seem like the author knows C. The C example of codecs is riddled with syntax errors. When he writes&lt;p&gt;&lt;pre&gt;&lt;code&gt;    struct Codec
    {
        *int (*encode)(*int);
        *int (*decode)(*int);
    };
&lt;/code&gt;&lt;/pre&gt;
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:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    struct Codec {
        uint8_t* (*encode)(uint8_t*);
        uint8_t* (*decode)(uint8_t*);
    };
&lt;/code&gt;&lt;/pre&gt;
And that doesn&amp;#x27;t exactly deal with ownership issues.&lt;p&gt;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&amp;#x27;t that something we&amp;#x27;ve been doing for a long time?</text></comment>
<story><title>Good Code Design from Linux</title><url>https://leandromoreira.com.br/2019/08/02/linux-ffmpeg-source-internals-a-good-software-design/</url></story><parent_chain></parent_chain><comment><author>aloknnikhil</author><text>Is the only takeaway that polymorphic design is good for extensibility? I mean, isn&amp;#x27;t that the whole point of polymorphism? But Linux&amp;#x27;s everything&amp;#x27;s a file design is great. Makes for a great user experience when you know all the knobs are under &amp;#x2F;sys on sysfs</text></comment>