2008/10/21 Stan Vassilev | FM <[EMAIL PROTECTED]> > > Hi, > > Guys, this is like junior school in here. > > Let me put some things in perspective: > > 1) The location of backslash on foreign keyboard is entirely irrelevant for > the choice of namespace separator. Why? You already use this *every day* to > escape characters in your strings and regular expressions. Anyone complained > about the location of backslashes in there? No. > > 2) Where the backslash is, is also where the {} and [] are on those > kayboards, as some people already said. > > 3) "Backslash is ugly" <-- are you honest? Which is uglier: :::Foo() > ::Foo() or \Foo(); The last one at least has intuitive meaning (like file > paths: absolute path). Face it that you'll be typing either one of the above > three a *lot*, and pick one that makes sense visually and for newcomers > alike. I think that's the backslash. > > 4) "But we want the same operator". Well? I want a pony, the fact is > however, the other languages have the design to afford the same separator > for namespaces, static methods and members. Shoehorning this in PHP while > maintaing BC will create such nightmares in big projects with ambigous > identifiers, autoload performance issues, that you'd wish you go back and > change the damn namespace operator to just about *anything* but "::". > > I wish the people who have a clear opinion of the above voice their > opinion. For those who aren't quite sure what the issues in point 4 are, > please just stay low and follow the list until you do. > > Regards, > Stan Vassilev > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Exactly my feeling. When it comes to dealings with 15+ MB codes (after excluding all 3-rd parity libraries), ambiguity problem becomes real even now. It's hard enough to think of good name for 2 similar, but different in realisation modules, so that you understand what they are for and to understand what is different between them. I deal with 3 projects 50 MB +- in size every day, jumping from one to other sometimes few times a day. such projects 100% have large amount of variables named equaly. If you begin to implement namespace support and access them outside namespaces, it becomes a nightmare to understand what it accessed. I see two solutions: 1). Change the separator. 2). Don't allow function, class, constant and variable naming same as namespace name. Make it a fatal error. Then this will be solved.
Other options like throwing something away or make an ambigity resolution mechanism personaly me don't make happy. Throwing something away leaves us with something half working. Ambigity resolution mechanism makes us to remember what is what (scrolling up and down tens of times a day is realy disturbing the work), but is for sure better than first one. If we combine all good things from all proposals, we can get one big solid thing. Just my IMHO, but still: 1). Change the separator. 2). Make resolution to global classes, functions, constants first and if not found - then to namespace. But realy, may be use self to point to namespaced function, class, method ? Same as $this in classes. That seems logical, because PHP is already using such mechanism. 3). Don't allow ambigity naming. Die with E_FATAL in such cases, don't allow thouse coders to write bad code, please do! I beg you! I don't know how parser works exactly, but maybe constant ambigity could be resolved by patch, witch resolves constant values at compile time. If that can't be done, than issue E_FATAL. Just my IMHO. Please, don't make a holly war of my post. I wount argue with holly war responces. Just tell me where I'm wrong and if that's because of implementation difficulties - explain, I will understand that techno bable :)