13 ms·
This has been posted before[1], and the "spiral rule" is a load of hooey. The correct rule is "follow the C grammar". An easier to remember and also correct ru
by stephencanon 10y ago
This has been posted before[1], and the "spiral rule" is a load of hooey.
The correct rule is "follow the C grammar". An easier to remember and also correct rule is "start at the identifier being declared; work outwards from that point, reading right until you hit a closing parenthesis, then left until you hit the corresponding open parenthesis, then resume reading right..." (this is sometimes called the "right-left rule"[2]).
The "spiral rule" dances around the truth without actually being precise enough to be useful.
[1] https://news.ycombinator.com/item?id=5079787 https://news.ycombinator.com/item?id=5079787
[2] http://ieng9.ucsd.edu/~cs30x/rt_lt.rule.html http://ieng9.ucsd.edu/~cs30x/rt_lt.rule.html
- thinkMOAR 10y agoI used to complain about re-posts too. But now it is the first time i see a reference to this website, which seems interesting to me. So i'm happy with new url on my to-read list. Thanks!