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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why PHP is better than Ruby

53 点作者 kgutteridge大约 14 年前

16 条评论

petercooper大约 14 年前
<i>PHP allows me to practice my typing skills, ruby doesn't. As a touch-typing enthusiast, I like to practice typing. The problem with ruby is that it allows me to do the same things that I can do in PHP, but with much less typing. [..] If I could create classes with public getters/setters that easily in my day-job, my fingers would atrophe and I'd get no exercise at all. I want my keyboard smoking after typing out a class definition, and a paltry three lines of ruby fails to satisfy.</i><p>This is certainly the best designed troll blog post I've seen but far from the most subtle..
评论 #2249234 未加载
callumjones大约 14 年前
I'm all for hating on PHP, but this article really does a lot to help the popular view that Ruby programmers are arrogant language elitists.
评论 #2249416 未加载
评论 #2249453 未加载
kayoone大约 14 年前
I am a long-time PHP programmer. I have first dabbled with PHP in 2000 when making a Page for my Quake2 gaming clans and i still love it. (yeah boo-hoo) That said, the syntax and language inconsistencies that are already described in this post (which come from its origin as a website toolkit) are really laughable. However, i got used to it over time. I can still produce results much faster than say with Java.<p>Also PHP has matured alot. I use the symfony framework for all the projects i do and its awesome, i think in some respects its even better than ROR and the upcoming 2.0 version will raise the bar even further. If this awesome framework wouldnt exist i would probably have switched to Python and Django by now, but as things are now i have never really felt the need to.
评论 #2249274 未加载
code177大约 14 年前
I am tired of the never ceasing language wars. It's true that some languages are more elegant than others, but at the end of the day the only thing that really matters to any person <i>other</i> than the programmer is whether or not they create something inspiring and/or useful.<p>All this time railing against other languages could be spent making awesome things, rather getting the proverbial tape measure out (yet again).
mkramlich大约 14 年前
Many of the positive points he cited for Ruby are true of Python as well. Except you don't have to type end end end end end end end end everywhere.<p>Now I'll get myself-self-self-self-self off to bed...
yuvadam大约 14 年前
Trolling or not, I cannot read these "my language is better" posts anymore.
评论 #2249466 未加载
smokestack大约 14 年前
"Oh, look! An opinion that goes against the mainstream on the news.yc frontpage."<p>"Oh, got baited into another anti-PHP rant."<p>I know that PHP has tons of suckage but it's a point that's been made ad nauseum. No need to point out that Hitler wasn't that nice of a guy. We all know.
kingofspain大约 14 年前
I long ago gave up trying to justify why I still use PHP as there will always be a counterargument (usually a long one) about how wrong I am. Once you get to that stage, there's a kind of serenity to be achieved :)
评论 #2249512 未加载
gurraman大约 14 年前
2005 called; they want their blog post back.
Newky大约 14 年前
I use php in my part time work every day, and I can honestly say this hilarious post made me consider using ruby. Unfortunately, I am the sole developer/maintainer on a huge project which languages don't stretch beyond php.<p>I came to this project in this state and I must say that clean code like demonstrated in this post, would have made the cleanup job I've attempted a heck of a lot easier.<p>Php is easy, but messy php code is not only extremely unsecure but also extremely hard for a new developer to adapt to.
评论 #2249516 未加载
dexen大约 14 年前
The points the blogger touches are mostly three-fold:<p>* backward compatibility: a valid issue. Some of the APIs PHP exposes come from different backgrounds than others, and to serve the (un)holy cow of the backward compatibility, argument order is preserved. Regretably the PHP lang designers did not choose to deal with the issue, and instead fell for the trap of backward compatibility :-(<p>* syntax: conventions were carried from C and derivatives. Not a valid issue -- the syntax is perfectly OK for a language without macro capability. (should there be macro facilities like in LISP, complex syntax would be a no-no, but that's not the case in PHP).<p>* Java-isms like countless getter/setter methods: not a valid issue; nothing in PHP suggests that way of use. Merely bad habits on the part of the blogger. Get over it :-)<p>For the once-in-a-blue-moon need of real getter/setter, use __get(), __set(), _call() etc. methods.<p>[EDIT: style]
评论 #2249400 未加载
eik3_de大约 14 年前
Even more reasons: <a href="http://www.bitcetera.com/en/techblog/2009/04/07/10-reasons-why-php-is-still-better-than-ruby--/" rel="nofollow">http://www.bitcetera.com/en/techblog/2009/04/07/10-reasons-w...</a><p>My favorite: <i>DRY won’t Pay your Bills</i>
jessedhillon大约 14 年前
Awesome. I think he could have picked some better criticisms of PHP though -- there's a truckload of them: <a href="http://www.quora.com/What-are-the-crawling-horrors-of-PHP" rel="nofollow">http://www.quora.com/What-are-the-crawling-horrors-of-PHP</a><p>It really is the worst of all the in-demand languages these days.
评论 #2249740 未加载
tintin大约 14 年前
Did he never hear about CTRL + Space? Anyway. If you don't like PHP just don't use it.
评论 #2249432 未加载
baggachipz大约 14 年前
I see what you did there.
djhworld大约 14 年前
He's played this one well, I'd imagine 90% of the readers would read the first paragraph and then run to HN/Reddit to lambast such a post.