Re:PHP best practices - The dos and don'ts
by troels on Saturday January 05, 2008 @01:52PM
(#95172)
> Exceptions leak a little bit of memory when thrown
So their suggestion for dealing with a limitation of the language implementation, is to not use a feature? Great.
Also, teaching people to do ridiculous sub-optimisations, like using ++$i instead of $i++ isn't really what I think of as best practice. Or telling people to avoid OO because it's slow. Now I know, where those poor newbies get this stuff from ...
Re:PHP best practices - The dos and don'ts
by scooter53080 on Saturday January 05, 2008 @02:31PM
(#95176)
The third example on the type safety slides bugs me (using the type safe comparison operator to prevent both a boolean true and non-zero int evaluating the same.) I would prefer use of a consistent return type from the function to begin with. I guess since some built in php functions behave this way, it's important to know/use...but I don't think I would recommend writing a function such that the type safe equal check is necessary.
Re:PHP best practices - The dos and don'ts
by dskhatri on Friday January 04, 2008 @11:01PM
(#95040)
Unfortunately, the slide navigation seems to be missing. Can only navigate slides by including the slide number in the URL eg. http://talks.php.net/show/php-best-practices/19 for slide 19.
Great way to get people to read your blog. Not to mention the horrid UI even when I fire up the fox...
So their suggestion for dealing with a limitation of the language implementation, is to not use a feature? Great.
Also, teaching people to do ridiculous sub-optimisations, like using ++$i instead of $i++ isn't really what I think of as best practice. Or telling people to avoid OO because it's slow. Now I know, where those poor newbies get this stuff from ...
Probably much easier to write secure, fast, elegant code when it doesn't need to do anything or interact with users...
They named their variables $int, $string and $bool...