3 ms·
I think C declaration syntax is a bit of an acquired taste --- it looks confusing at first but once you "get" it everything falls into place and it feels comple
by userbinator 12y ago
I think C declaration syntax is a bit of an acquired taste --- it looks confusing at first but once you "get" it everything falls into place and it feels completely natural. Arguments that it is difficult to read because it is not "left to right" contrast with the fact that the expression syntax is not "left to right" either in most programming languages; 2 + 3 * 4 parses as 2 + (4 * 3) in most languages that use this syntax.
Also worth mentioning that the "clockwise/spiral rule" that this article links to for reading C declarations is actually wrong, as Linus Torvalds helpfully points out here: https://plus.google.com/111049168280159033135/posts/1ZhdNwbjcYF https://plus.google.com/111049168280159033135/posts/1ZhdNwbj...
This is probably a better article for understanding them: http://www.unixwiz.net/techtips/reading-cdecl.html http://www.unixwiz.net/techtips/reading-cdecl.html
- GhotiFish 12y agoYou know. I was working on a project last day and a horrible bug happened where the timing system broke and spammed my console and corrupted my database. You know what instigated it? A precedence error.