News for hackers. Stuff that matters.
Re:PHP best practices - The dos and don'ts by aston on Saturday January 05, 2008 @01:52AM (#95073)
Awesome how I can't see the site in IE because the author doesn't like the browser.

Great way to get people to read your blog. Not to mention the horrid UI even when I fire up the fox...

Re:PHP best practices - The dos and don'ts by ks on Saturday January 05, 2008 @10:40AM (#95134)
I agree. The UI is terrible. It was pure luck that I tried the arrow keys to navigate. And just blocking IE users like that is pure arrogance.
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 marcus on Saturday January 05, 2008 @02:45AM (#95081)
Apparently a working UI isn't considered best practice...

Probably much easier to write secure, fast, elegant code when it doesn't need to do anything or interact with users...

Re:PHP best practices - The dos and don'ts by Funky_ on Saturday January 05, 2008 @10:35AM (#95133)
The dos and don'ts of UI design should be their first project. :)
Re:PHP best practices - The dos and don'ts by ks on Saturday January 05, 2008 @10:53AM (#95139)
And there are several don'ts in the slides too. Never give variables the same name as functions or other parts of the language.

They named their variables $int, $string and $bool...

Re:PHP best practices - The dos and don'ts by randallsquared on Saturday January 05, 2008 @01:50PM (#95171)
In PHP it hardly matters, since variables have their own namespace. PHP is a lisp2.
Re:PHP best practices - The dos and don'ts by SwellJoe on Saturday January 05, 2008 @07:03PM (#95205)
It might matter to the human reading the code.
Re:PHP best practices - The dos and don'ts by randallsquared on Sunday January 06, 2008 @12:04PM (#95356)
Well, sure, but that cuts both ways. :) It's convenient to have names like $bool and $int for didactic purposes, at least.
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 henryw on Saturday January 05, 2008 @02:53AM (#95082)
Interesting stuff from the slides:

  Use commas with 'echo' instead of dot concatenation
  Where possible use ++$i instead of $i++
  Use the class of ctype functions to check strings
Lots of slides here: http://talks.php.net/
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.
Re:PHP best practices - The dos and don'ts by aaroneous on Friday January 04, 2008 @11:10PM (#95044)
Right and left arrows on my keyboard worked for me :]
Re:PHP best practices - The dos and don'ts by dskhatri on Friday January 04, 2008 @11:34PM (#95049)
oops.. thanks! :)