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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

On PHP 5.3's Namespace Backslash Backlash: The PHP Internals Team was Right?

23 点作者 KrisJordan将近 16 年前

8 条评论

wvenable将近 16 年前
No, the PHP internals team was not right.<p>The author missed the only valid argument: PHP already has a namespace operator! It is '::' just as it is in C++. Classes are namespaces and PHP should have worked just like in C++ where they stole the design from in the first place.<p>Instead, because nobody wanted to fix the bunged up internals to make it work properly, they decided to add this new character and make the whole language that much more complicated. Now we have this new operator that we didn't need and a bunch of different syntax and semantics for accessing static class members and namespaces.
评论 #735411 未加载
Maascamp将近 16 年前
Having started using the new namespaces as well as some of the other new features (late static binding FTW), I completely agree with the author.<p>I too got caught up in the hype when the whole namespace debacle first hit, but after using them in a sizable project I have no gripes whatsoever.<p>Also, the character choice isn't really bad at all. And before those with non-english keyboards start griping, I'm currently consulting in Stockholm and as far as the Swedish keyboard goes, you guys have much bigger fish to fry (it's even hard to type a semi-colon).
评论 #735605 未加载
generalk将近 16 年前
So the PHP internals team made a poor decision, but because namespaces are better than the ridiculous measures taken to work around the <i>lack</i> of namespaces, they're vindicated?<p>No. PHP may be getting better, but I can't stand it any longer after using things like Ruby and Python.
jacquesm将近 16 年前
My approach to new features in PHP is very pragmatic, after having been bitten a couple of times I wait for two major releases before using a new feature. The ones that survive the intermediary release are usually here to stay.<p>PHP is a great language in concept but I really wished the powers that be would have a little more sense of orthogonality in what they build.<p>Anybody that designs a language should have a look at the 68K series assembler, it's so compact and predictable. They did a real good job there. And the PHP designers did a lousy one.<p>Scope and namespaces in PHP are amongst the weirdest I've ever encountered in a language.
jsonscripter将近 16 年前
<i>After using namespaces in 5.3 I'm more than sold, I'm in lust</i><p>Woah now, it's just a little syntax... relax a little. There's a whole world of programming languages out there with more variations on syntax than you can dream of. Then again, maybe I don't see what the big deal is?
评论 #735201 未加载
评论 #735179 未加载
Batsu将近 16 年前
A wealth of links for further background, if anyone is interested on the original issue.<p><a href="http://news.ycombinator.com/item?id=344198" rel="nofollow">http://news.ycombinator.com/item?id=344198</a>
shaunxcode将近 16 年前
I still don't see why the single : would not have worked?
评论 #735249 未加载
TweedHeads将近 16 年前
Somebody please take PHP, fork it, fix all the annoyances and inconsistencies, rename it as PHX and I'll drop old PHP like a herpetic whore.