NB: for background on this idea, you should probably read the original post from the Elder Days....
So, does anyone still have those "DOH!" moments? Like this morning, while looking at some old code, and I decided it wasn't properly annotated.
So, I sifted through one honkin' big file, looking at variable assignments and conditional loops and adding some commentary on just what the thing was actually doing.
And I finished. It's just commentary, but since it's a working intranet site, I linted it:
kadmin@foobar
$ php -l newsite.php
PHP Parse error: syntax error, unexpected end in newsite.php on line 637
Errors parsing newsite.php
OK, so while adding comments I modified a conditional someplace? Stupid me goes and starts reading the loops again, checking indents, etc. Then it dawns on me:
kadmin@foobar
grep -c "{" newsite.php
55
kadmin@foobar
grep -c "}" newsite.php
55
It's not a brackets problem at all. Back to my comments, where I found this about halfway down the page:
some_big_half_forgotten routine(); // I *think* this keeps the gonkulator from frobnitzing <??>
DOH! That's 30 minutes of my life (NON-billable) that I'll never get back. Maybe that'll teach me to use parentheses, like God intended? :glare: