<story><title>My personal C coding style as of late 2023</title><url>https://nullprogram.com/blog/2023/10/08/</url></story><parent_chain><item><author>Uptrenda</author><text>IMO, defining your own types is one step too far. Now everyone who is already familiar with C types has to learn your own quirky system to understand one program. I think it does probably make sense to be specific about the sizes though e.g. using uint32_t over just uint (and expecting to receive some architecture-dependent size you might not get with uint.) These types should be defined in the right header (I think it depends on compiler?) It&amp;#x27;s been a while since I wrote any amount of C so my apologizes if this isn&amp;#x27;t correct.</text></item></parent_chain><comment><author>WalterBright</author><text>The reality is that C `int` is 32 bits in size.&lt;p&gt;Sure, that&amp;#x27;s not true for 16 bit targets. But are you really going to port a 5Mb program to 16 bits? It&amp;#x27;s not worth worrying about. Your code is highly unlikely to be portable to 16 bits anyway.&lt;p&gt;The problem is with `long`, which is 32 bits on some machines and 64 bits on others. This is just madness. Fortunately, `long long` is always 64 bits, so it makes sense to just abandon `long`.&lt;p&gt;So there it is:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    char - 8 bits
    short - 16 bits
    int - 32 bits
    long long - 64 bits
&lt;/code&gt;&lt;/pre&gt;
Done!&lt;p&gt;(Sheesh, all the endless hours wasted on the size of an `int` in C.)</text></comment>
<story><title>My personal C coding style as of late 2023</title><url>https://nullprogram.com/blog/2023/10/08/</url></story><parent_chain><item><author>Uptrenda</author><text>IMO, defining your own types is one step too far. Now everyone who is already familiar with C types has to learn your own quirky system to understand one program. I think it does probably make sense to be specific about the sizes though e.g. using uint32_t over just uint (and expecting to receive some architecture-dependent size you might not get with uint.) These types should be defined in the right header (I think it depends on compiler?) It&amp;#x27;s been a while since I wrote any amount of C so my apologizes if this isn&amp;#x27;t correct.</text></item></parent_chain><comment><author>rkagerer</author><text>The author &lt;i&gt;did&lt;/i&gt; qualify it with &lt;i&gt;personal&lt;/i&gt; coding style.  Frankly the standard types are too verbose and I wish this guy&amp;#x27;s elegant and clear list had been the one that was adopted way back when.</text></comment>