if (strpos($file, '.') === 0) continue;
What else DOES that do?
Omits any UNIX hidden files (ones that start with a .). This includes the directories "." and "..".
I find the brackets still helpful if skimming quickly (as if to find a section of the code).
Hm, I always rely on indentation for this. Otherwise one has to keep track of every single brace in order to know exactly how many levels deep one is.
Also, the real reason for including it is to be absolutely correct. I see omitting the brackets as a shortcut, just like omitting the ; in javascript.
But omitting a semicolon in Javascript is bad because it can lead to the code looking like it does something completely different to what it actually does:
Code:
var a = 3,
b = 1 + a
(b - 4) && doSomething()
... and is inserted anyway. Omitting a brace isn't nearly so ambiguous, especially with proper indentation, and doesn't make extra work for the compiler/interpreter.
thankyou you forgot to put some '{' in there but i got it thankyou..
No, I actually accidentally left one in (the last one, I was editing your code, and it was outside the visible area of my textbox).
well without the brachets it didnt work..
you guys are confusing me...
Don't mind us, we just went off on a tangent about coding style
Bookmarks