ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life
back «  1  2 

Re: It's official: I am idiot

I find the \ also problematic because of its universal use as escape character. Couldn't find anything in the wiki and the chat log about @
Any reasons not to use that one? (it has sort of a name space meaning - package@function() - even if it is read backwards compared to email address)

Re: It's official: I am idiot

There are already quite a lot of (negative) comments on slashdot: http://developers.slashdot.org/article.pl?sid=08/10/26/1610259&from=rss

I thought '::' was a done deal, but I am disappointed with the current choice. One of the best comments on slashdot was quote :

And this is (one of) the many reasons PHP sucks:

Java:
Attribute/Method access: foo.bar
Static method access: Foo.bar
Package access: foo.bar.baz

C#:
Attribute/Method access: foo.bar
Static method access: Foo.bar
Namespace access: foo.bar.baz

Python:
Attribute/Method access: foo.bar
Static method access: Foo.bar
Module access: foo.bar.baz

PHP:
Attribute/Method access: $foo->bar
Static method access: Foo::bar
Namespace access: foo\bar\baz

Re: It's official: I am idiot

The "@" symbol courldn't be used because it is already in use in front of function names for a totally different meaning. I guess the PHP folks thought this was fairly obvious, and therefore they do mention it. As Lukas has said several times already, please take the time to read everything. It's been a few years and I would think the people involved have quite a thourough knowledge of the ASCII table, don't you?

As for the difference between PHP access operators and other languages, maybe the PHP Group considered that resolution rules are just too complex to resolve if there is only one operator. Compiled languages don't have this problem because, well, they are compiled while PHP needs to resolve all this at execution time. When you have 4 or even 3 paths to look at to load one single class symbol, it soon becomes a nasty performance problem that no opcode will ever be able to solve. Again, all this has already been said many times on the lists.

Re: It's official: I am idiot

The backslash will make coding PHP for non-US keyboard layouts a real pain-ITA. At least for that criterion, the backslash will fail completely.

I'm sorry to say so, but this is the wrong decision. Thank you for letting us comment on this.

Re: It's official: I am idiot

I honestly don't understand what's wrong with a simple dot/period for separating namespaces, classes, methods, functions, etc.

It's not a problem if you don't suck at writing lexers/parsers.

Seriously, what's wrong with a simple dot? And don't say "because that's the operator for concatenation", because that's simply not an issue at all.

Using a backslash is the ugliest thing I've ever seen, and I'm considering not to use namespaces for this reason (as much as I love namespaces, I will vomit in my mouth for each backslash I write).

Re: It's official: I am idiot

Well so what does "foo.bar" mean? Does it mean contactenate the (the implicit) constants "foo" and "bar"? Or it is a namespaced identifier? Its really not about competence .. its about past mistakes which were made for whatever reasons and the fact that we prefer to not make a drastic BC break that would affect pretty much every single PHP script in existence.

For those that feel we should just break BC and move on, I refer you another recent blog entry.

«  1  2