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.

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

23 pointsby KrisJordanalmost 16 years ago

8 comments

wvenablealmost 16 years ago
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 未加载
Maascampalmost 16 years ago
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 未加载
generalkalmost 16 years ago
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.
jacquesmalmost 16 years ago
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.
jsonscripteralmost 16 years ago
<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 未加载
Batsualmost 16 years ago
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>
shaunxcodealmost 16 years ago
I still don't see why the single : would not have worked?
评论 #735249 未加载
TweedHeadsalmost 16 years ago
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.