3 ms·
While you are correct that the spiral rule is an over-complicated (and sadly, popular) rule for C declarations, that doesn't really answer GP's point -- that pu
by cyphar 7y ago
While you are correct that the spiral rule is an over-complicated (and sadly, popular) rule for C declarations, that doesn't really answer GP's point -- that putting the types after the binding results in much less messy type signatures. This was the reason why Go went with such a setup (and presumably also Python, though their hand was slightly forced by backwards compatibility concerns).
- jstimpfle 7y agoConsider it a reaction to something else than what might be the true point of this comment. Nothing wrong about that. And that point is pretty much a straw man, intentionally cherry-picked and obfuscated. The type signature in my signal(3) manpage is given as typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler); And functions taking and returning function pointers are exceedingly rare. In practice I still find C type syntax the easiest to read (it's so concise, and in fact there is almost no type synax because it's just expressions). The valid argument for me why we should move away from that syntax is tooling - the syntax is hard to parse for machines (but not for humans) because it requires serial reading and complete preprocessing from the start of the file.