3 ms·
You want something even more life-changing? There's the Spiral Rule: http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html
by alfiedotwtf 7y ago
You want something even more life-changing? There's the Spiral Rule: http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html
- rcxdude 7y agoI think the 'declaration follows use' insight is far more useful than the 'spiral rule', which manages to get the same result but completely obscures the intuition.
- jstimpfle 7y agoYup. "Declaration follows use" was Ritchie's idea of making it work[0] (I think it was his own). Unfortunately, while it is often useful, it also has its problems. Lacking a keyword, a type table is needed in the parser to recognize declarations. Thus, need to parse everything from the start. The syntax is very concise and easy to read in simple to moderate cases, but difficult to read for more complicated declarations, like functions returning function pointers. And few people know how it works and get confused. I wonder why that knowledge is not a lot more common. [0] https://www.bell-labs.com/usr/dmr/www/chist.html https://www.bell-labs.com/usr/dmr/www/chist.html