On 10.09.2008, at 03:22, Stanislav Malyshev wrote:
I disagree. The idea is that I get control over how I manage to
global namespace. As such its sensible that I want to use "mysql"
in my code instead of DB::mysql.
You may use it. You just won't get wildcard imports, because that
doesn't work conceptually.
Also when it comes to resolution, inclusion order should not
matter, period. if it does we have a serious flaw in our design. if
we cannot
We already have this serious flaw in our design. If we use "new
Foo()", and it's definition not included, it resolves differently
(namely, to fatal error) than if we had included the definition.
Also, with inheritance, if you include or define inherited classes
in wrong order - i.e. child before parent - you may get problem too.
You'd say this can be changed by autoloading, moving classes around,
etc. - but behavior you complain about can be changed easily too,
you just insist there would be no possible case, however hard you
try to make a mistake, to get different resolution.
All the issues you note will give you a nice error message and do not
run the risk of silent misbehavior.
make a performant solution in this case, we better have nothing. that
I don't see how it's better to have nothing at all than a solution
that works in 99% of cases - unless you try on purpose to write code
that doesn't work. I also find it very strange that you and other
people are so insistent on having no namespace solution at all. How
that would help you? How that would make PHP better?
As stated above, the key is that in 1% of the cases you could end up
running totally different code than expected. This means it will be
hard to debug and worse opens up an entirely new class of security
issues.
if some core developers have extensive experience with namespaces
in Java and packages in other languages, these people have done
more with this construct in PHP than many of us have. Also while I
do not know all
You seem to suppose neither me nor people I talked with didn't try
to do things with namespaces in PHP. This is not correct.
I did not say that. I said:
"they have all used the namespace implementation in PHP 5.3 _more_
extensively than probably all core developers"
notice the "more" and the "probably" ..
that they are solid developers. So I think you are brushing their
expectations off too lightly here.
By "brushing too lightly" you mean "spending three days in
discussion, explaining repeatedly point by point each decision and
each tiny point of each argument, in full detail", right?
You are not discussing most points. For the most part you are saying
these people are using (or trying to use) namespaces wrong.
The fact that people expect that they can call a function from a
namespace in a way that looks different from a static method call
however is imho clearly something that needs to be addressed. One way
I don't see why they have to insist on that. I think it's just
misconception, making artificial differences where they do not exist.
Because its important to quickly locate logic, because there is a huge
difference in a function and a static method. Actually I find it quite
irritating that you can even argue that its irrelevant if something a
function or a static method call. This to me means you have left sound
reasoning and are just being defensive.
I am not convinced that you have demonstrated the mentioned used
cases are really so clearly "the wrong way" that they should not be
supported.
What could convince you that something is a wrong way,
theoretically? I showed that it has hight WTF factor, can lead to
potential bugs, and does not add anything to functionality. So far
strongest argument for them I got is "I don't want :: in names". For
me, "don't want :: in names" versus "buggy unmaintainable code" is
clearly wrong way. But some think otherwise, that's their right.
No, people asked to be able to:
- shorten class/function calls
- be able to differentiate calls to namespaced functions vs. static
method calls
This has nothing to do with people not liking double colons.
I think that PHP is not an OO language and as such there is no
reason to
Namespaces is an OO feature, however. It is only natural that if you
don't want to touch OO, you get no namespaces. PHP has tons of
features that make sense only if you use OO, that's one more of them.
I disagree. There is nothing OO only about namespaces conceptually.
regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php