TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

PHP best practices - The dos and don'ts

10 点作者 dskhatri超过 17 年前

7 条评论

aston超过 17 年前
Awesome how I can't see the site in IE because the author doesn't like the browser.<p>Great way to get people to read your blog. Not to mention the horrid UI even when I fire up the fox...
评论 #95134 未加载
troels超过 17 年前
&#62; Exceptions leak a little bit of memory when thrown<p>So their suggestion for dealing with a limitation of the language implementation, is to not use a feature? Great.<p>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 ...
marcus超过 17 年前
Apparently a working UI isn't considered best practice...<p>Probably much easier to write secure, fast, elegant code when it doesn't need to do anything or interact with users...
Funky_超过 17 年前
The dos and don'ts of UI design should be their first project. :)
评论 #95139 未加载
scooter53080超过 17 年前
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.
henryw超过 17 年前
Interesting stuff from the slides:<p><pre><code> Use commas with 'echo' instead of dot concatenation Where possible use ++$i instead of $i++ Use the class of ctype functions to check strings </code></pre> Lots of slides here: <a href="http://talks.php.net/" rel="nofollow">http://talks.php.net/</a>
dskhatri超过 17 年前
Unfortunately, the slide navigation seems to be missing. Can only navigate slides by including the slide number in the URL eg. <a href="http://talks.php.net/show/php-best-practices/19" rel="nofollow">http://talks.php.net/show/php-best-practices/19</a> for slide 19.
评论 #95044 未加载