TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

35+ Techniques to enhance your php code

2 pointsby silv3r_m00nabout 13 years ago

1 comment

garyrichardsonabout 13 years ago
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.