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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

PHP Is A Husk

13 点作者 lucasoman超过 15 年前

12 条评论

thaumaturgy超过 15 年前
I usually don't jump into these kinds of threads. You get an awful lot of programmers -- some hobbyist, some professional, some experienced, and most of them self-taught -- all with their own prejudices and methodologies, all arguing over what the "right" way is. They go absolutely nowhere, do nothing productive, and turn into a huge time sink for everyone involved.<p>That said, this article, and every other one like it, reeks of some strange belief that every single language is supposed to have all of the features of some programmer's favorite language, as well as all of the neat new trendy stuff, and if the language doesn't support all of that -- well then it's dead! Or dying. Or "a husk".<p>There doesn't seem to be any realization on the part of the programmer that a particular language is just a tool, usually designed for a specific application. The programmer is attempting to fit a square peg into a round hole, and they're cursing at the square peg because it doesn't fit.<p>Let's take one example: closures. They sounded interesting, and potentially could solve a problem in a large JavaScript library I was working on. So I got to know them, I practiced with them, I made sure I grokked them before trying to apply them. Then I put them to work, and found that they ended up making my library unnecessarily complex, that they caused some odd behaviors occasionally, and that they didn't solve any problem that I couldn't more easily solve using simpler methods.<p>So, does PHP's lack of this author's favorite features really make it a "husk"? No, not at all. Applications as large and complex as osCommerce don't rely on those language features; they rely on the features that the language does have, and they work just fine.<p>One of the most basic skills programmers need to have in their toolbox is the ability to adapt their habits according to the tools they're using. The programmers that spend their time writing blog posts like this one don't seem to have picked that up.<p>...Ugh, this just cost me 10 minutes that I could've spent actually working on one of my projects. :-(
评论 #787420 未加载
评论 #787421 未加载
评论 #787454 未加载
评论 #787429 未加载
评论 #787469 未加载
jacquesm超过 15 年前
It's a crappy title, but the article is pretty good.<p>PHP is a niche language, the niche is probably best described as "for want of something else that seems so easy to use and has such a low barrier to entry we are forced use it for web development".<p>The interesting thing here is that apparently the difference between PHP and the 'rest' of the languages out there is not large enough to supplant PHP in the WWW domain.<p>It's close enough to C that a whole generation of C programmers is intuitively at home in PHP, until they start using its advanced features.<p>But as long as you have to do simple stuff and get paid for that it almost always works. The few times that it doesn't you wished you never knew about the language though.<p>Just imagine, a language where the default 'scope' is global but globals are not available to functions and silently get replaced with empty variables. Who came up with that gem ?
评论 #787394 未加载
评论 #787386 未加载
评论 #787395 未加载
dpcan超过 15 年前
If you are trying to do something "more advanced", why are you trying to use PHP at all? What do you consider "advanced"? Just the WAY you use the language, or the application you are trying to write?<p>PHP is trying really hard (it seems) to be a more advanced language, possibly to get new users to move over from other languages.<p>But they don't need to.<p>They should just stick to their roots, do what they do best:<p>Super small learning curve, low barrier to entry, it's everywhere, it works great for most apps, keep CRUD super-simple.
评论 #787405 未加载
评论 #787440 未加载
评论 #787398 未加载
garnet7超过 15 年前
My guess is that many developers probably don't actually <i>choose</i> PHP per se but rather get <i>stuck</i> using it because that's what the shop they work for uses, or that's what the current site is implemented in and they're only adding a feature, or that's what the client is asking for, etc.<p>More interesting to me is the question: Why is PHP beating Python in this space? Some guesses:<p>* PHP webapps far easier to deploy.<p>* PHP docs give more usage examples, and also allow user comments.
pyman超过 15 年前
Very mediocre post. Including the comments.<p>"Use php, python, no, use ruby instead! Facebook uses PHP, YouTube Python, blah blah".<p>Kids, kids, behave! Scripting languages are for kids and web developers who don't know anything about programming and software engineering.<p>I've worked with Perl and Python developers for the last couple of years... they struggle to understand design patterns and don't even know what a domain object is.
shaunxcode超过 15 年前
I don't think the lambda and closure support was intended to mesh so succinctly object oriented features of php. You have to realize php is a multi-paradigm language and proceed accordingly. You can honestly implement your own oo system using arrays and anon functions/closures if you would like (much like perl). The only thing making it a little fugly/brutal is the HORRIBLE php "array(" syntax.
pyman超过 15 年前
Very mediocre post. Including the comments. I think scripting languages are for kids and web developers who don't know anything about programming and software engineering.<p>I've worked with Perl and Python developers for the last couple of years... they struggle to understand design patterns and don't even know what a domain object is.
pyman超过 15 年前
Very mediocre post. Including the comments. I think scripting languages are for kids and web developers who don't know anything about programming and software engineering.<p>I've worked with Perl and Python developers for the last couple of years, they struggle to understand design patterns and don't even know what a domain object is.
pyman超过 15 年前
I think scripting languages are for kids and web developers who don't know anything about programming and software engineering.<p>I've worked with Perl and Python developers for the last couple of years... they struggle to understand design patterns and don't even know what a domain object is.
mjs超过 15 年前
The corresponding PHP bug report:<p><a href="http://bugs.php.net/bug.php?id=47665" rel="nofollow">http://bugs.php.net/bug.php?id=47665</a><p>(Closed as "not a bug". Surprise!)
ojbyrne超过 15 年前
I found the repeated misspelling of "lambda" to be off-putting.
评论 #787435 未加载
评论 #787609 未加载
onreact-com超过 15 年前
It is? Strange, mine still works. Am I a PHP zombie?<p>On a side note: I'm tired of the "Pull a Calacanis" type of headlines like "x is dead", "x sucks" or "x is bullshit".<p>Please come up with something better.
评论 #787391 未加载
评论 #787385 未加载
评论 #787365 未加载