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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

35+ Techniques to enhance your php code

2 点作者 silv3r_m00n大约 13 年前

1 comment

garyrichardson大约 13 年前
A bunch of cargo cult ideas and otherwise terrible advice. Looks like it was written for PHP4.<p>There is almost no justification for any of these techniques and they don't come close to PHP best practices.<p>For example, "1. Do not use relative paths , instead define a ROOT path", what advantage does this provide? Use an autoloader. Furthermore:<p><pre><code> define('ROOT' , pathinfo(__FILE__, PATHINFO_DIRNAME)); </code></pre> Is completely redundant. If you move your file, you might as well just keep using your relative path.<p>I'm going to stop there.. but just about every technique misses the point.