On 16.10.2008, at 17:37, Stanislav Malyshev wrote:
B. There's a huge problem with this proposal which you seem
consistently to ignore despite all my attempts to explain it. Failed
autoload on each call is BAD. Very bad. It is not cacheable, it
leads to multiple disk accesses and it is absolutely undetectable to
the PHP user without the use of special tools. So making all
existing code contain this performance bomb unless you rewrite it is
very bad. It's better to have this code fail and provide simple
script to fix it in automatic fashion. The fix you propose - writing
use's - is not enough because as you noted later inertia would make
users not to use this code and thus have huge performance hit -
which most of them even wouldn't know where it came from.
first up i am a bit irritated by the use of the term "internal class",
i guess you both mean to say "class in the global namespaces"?
I talked to many OO developers and most of them were OK with
using :: on internal classes when using namespaces.
second, we are not talking an issue where prepending with a double
colon solves the issue, since example was about a case where i want to
autoload a file that defines a class in the current namespace and not
fall back to the global namespace.
however your performance concerns are quite valid.
imho the thing is, that the person who is developing a namespace that
is autoloadable knows this (or should know this), as a result its his
obligation to either trigger the autoload via a "use" statement or by
prepending the current namespace name to the class name.
imho the main use for namespaced code will be libraries and not
application level code (with the exception that some people have
mentioned that they might want to stick their templates in
namespaces), so i think this burden is legit, since most of us spend
their time writing application level code and not library code (sorry
full time ezc/zf developers).
so imho the solution is "none of the above". the solution is that
however wants to make his namespaced code to be autoloadable must make
sure he explicitly triggeres the autoloading.
regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php