[TYPO3-dev] [TYPO3-core] New TYPO3 Coding Guidelines
Bastian Waidelich
bastian at typo3.org
Mon Jul 13 19:18:41 CEST 2009
Mathias Schreiber [wmdb >] wrote:
Hi Mathias,
> Never underestimate the wonder of addition.
Never underestimate the amount of bugs introduced or not identified due
to bad readability ;)
But sure, you'll always have to weight performance off readability, off
features, off flexibility..
> Did you know what the two mostly called functions are in TYPO3 requests?
> is_array() (which is ok) and strlen().
No, I didn't know that - interesting!
> "One strlen can't hurt"
I would never claim this..
But.. Even though
if (!isset($text{5})) echo 'text too short';
is faster than
if (strlen($text) < 5) echo 'text too short';
I'd go for the strlen() variant unless it's a really critical part of
the code. Just because it's more readable and meaningful (In this case a
goo PHP optimizer will do the rewriting anyways).
Just my 2ct
Bastian
More information about the TYPO3-dev
mailing list