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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What's your beef with PHP?

15 点作者 meneses超过 8 年前

12 条评论

open-source-ux超过 8 年前
I don&#x27;t have any beef with PHP, although I switched from learning PHP to Python.<p>For web development, no other language will get you producing dynamic websites and <i>deploying</i> them as easily as PHP. Compare deployment of Python or Ruby web apps - messier and not simple.<p>What don&#x27;t I like about PHP? The language itself. Its piecemeal, adhoc development is laid bare in its unattractive syntax (this is always subjective I know).<p>On the positive side, my impression is that the PHP community are open to criticism - they have to be given the amount of negative comments thrown their way.<p>This is in contrast to other language communities that have far too much zeal and sensitivity to criticism.<p>That criticism against PHP is also taken on board at times in the implementation of PHP&#x27;s language features or best practices. I&#x27;ve been impressed by PHP&#x27;s huge speed up in PHP 7. I wish other scripting languages would also address speed and memory usage with the same priority.<p>Finally, it&#x27;s worth stating the obvious: if you&#x27;re looking for a CMS, a message board, a blogging platform etc, PHP gives you enormous choice. And yes, some of these solutions do follow modern, secure coding practices. Look at the other popular scripting languages for web development and you&#x27;ll find the variety of solutions far more spartan.
Avalaxy超过 8 年前
I haven&#x27;t done any PHP scripting for at least 6 years, but my beef was mostly with the community, not the language. If you do your best, you can write decent and clean code in PHP. But the community largely exists of people who don&#x27;t have the slightest clue what they&#x27;re doing and who are writing absolute garbage pieces of code. Usually when there&#x27;s a data leak on a website, it&#x27;s the result of insecure PHP scripts (again, the language has ways to prevent this, but the scripters just suck).
neilsimp1超过 8 年前
More than anything else, it&#x27;s standard library.<p><a href="https:&#x2F;&#x2F;eev.ee&#x2F;blog&#x2F;2012&#x2F;04&#x2F;09&#x2F;php-a-fractal-of-bad-design&#x2F;#standard-library" rel="nofollow">https:&#x2F;&#x2F;eev.ee&#x2F;blog&#x2F;2012&#x2F;04&#x2F;09&#x2F;php-a-fractal-of-bad-design&#x2F;#...</a>
评论 #13648079 未加载
Xeoncross超过 8 年前
I&#x27;ve been writing PHP for over 10 years.<p>1) PHP is slow, uses too much memory. (I wrote the MicroMVC framework and IOSQL)<p>2) Makes concurrent (and especially parallel) computing hard (file locking and pcntl_fork())<p>3) PHP isn&#x27;t well though-out (like Javascript) so you are always second-guessing the std lib because of odd&#x2F;short-sighted design choices.<p>I moved to Go and lost nothing.<p>However, PHP is (like Javascript) improving and will probably eventually (like Javascript) get parallel computing right.<p>Where the users are the features are. That is why PHP, Java, and Javascript aren&#x27;t going anywhere fast.
评论 #13641602 未加载
iDemonix超过 8 年前
I don&#x27;t have any, it&#x27;s great, depending on your use case. I think it&#x27;s because I learnt it growing up (age 14 onwards) that I always fall back to it as my &#x27;natural&#x27; coding language.<p>If someone gives me a big file of text to parse through, even though I know Python, can use Perl and BASH, I&#x27;ll likely still use PHP if it&#x27;s a one-time thing (sometimes even if it isn&#x27;t). Why? Because within 5 minutes, I can have a script that reads a file from anywhere, parses it line by line and does any number of interpretation. No worrying about casting strings to integers, no worries about general syntax or indenting (Ok, this is a benefit of Python, but if you just need to do something on the fly, PHP!).<p>IMO PHP is very easy to use, very easy to learn and can do almost anything - good and bad. Good because you can use it to solve tons of problems, bad because everyone learns it early on, or as their first language (like me), and therefore most people aren&#x27;t great at it, the community gets worse.
anamoulous超过 8 年前
If you embrace what PHP is good at, which to me is fast, easy to understand code that is dispatched once per web request in a shared nothing state, PHP is great. When you have to deal with PEAA style PHP, things start to go off the rails in both speed and simplicity.<p>I happen to like PHP&#x27;s standard lib: it&#x27;s big and addresses a lot of needs in building web apps. But you don&#x27;t really see tons of new high quality bindings or libraries being introduced at the rate that, say, Go is getting them.<p>If someone told me I had to build a product from scratch in PHP, I would probably start here: <a href="https:&#x2F;&#x2F;github.com&#x2F;exflickr&#x2F;flamework&#x2F;blob&#x2F;master&#x2F;docs&#x2F;philosophy.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;exflickr&#x2F;flamework&#x2F;blob&#x2F;master&#x2F;docs&#x2F;philo...</a>
评论 #13645353 未加载
评论 #13646074 未加载
codegeek超过 8 年前
I don&#x27;t have any beef with PHP. It pays for my current living so I don&#x27;t complain. PHP 7 has been a great improvement over the previous versions so that helps as well. At the end of the day, it is just another tool.<p>Best thing about PHP applications is that even my grandmother can deploy it. Yes, that can be bad or good depending on where you are looking from.<p>Add frameworks like Laravel and you can create some serious prototypes in no time. That&#x27;s what I care about to get something out of the door.
smilesnd超过 8 年前
My beef with PHP is all the added traffic I get on my http server. Every day I get a list php directories get request from people looking to score on some low hanging miss configured lamp box. Then on the flip side the people that do have php files miss configure they get turn into DDoS boxes against me.
评论 #13642743 未加载
taf2超过 8 年前
I love PHP- it&#x27;s a great get it done language. I think people just like to complain.
Bahamut超过 8 年前
The one thing that has most frustrated me is PHP&#x27;s array syntax.
评论 #13642271 未加载
wazanator超过 8 年前
No problem with the language itself more of a problem with the people who use it and their compulsion to use it for things that don&#x27;t need it.<p>For example it feels like we can&#x27;t go a year without WordPress making the news for a security flaw.
crispytx超过 8 年前
PHP is the bomb.