I actually don't have much experience with generics, so won't argue about
their readability, but this article is all about Java's implementation of
generics, so I don't know how much sense this article gives in that
context.
But it's ok, I see just one person that supported proposal. I think case
closed.
I see what you are trying to achieve, but I hope this will never make
into
PHP mainly for impact on readability. I'd like to quote Eric Armstrong,
a
passionate Java/Ruby dev:
I decry their very existence. They are the ultimate condemnation of
static
type checking--because their very addition has virtually destroyed both
the
readability and elegance of the language.
To make my case, let's start with a quasi-mathematical definition of
"elegance".
In my view, elegance is a function of power and simplicity. Power is
measured
by how much you can do. Simplicity is the inverse of the number of
characters
it takes to achieve the result. So more power with fewer characters
equals
"elegance"
http://www.artima.com/weblogs/viewpost.jsp?thread=299081
__________________
I question the "need to validate" types part. I'd say you're better off
using a completely different language if you want to use strong typing.
For PHP: Embrace duck typing, write less boiler-plate code (thus
reducing the need for "smart" IDE) and be happy :-)
We have typehints, that was my point here.
That's the same as saying you can ignore most of the C++ feature and
that will make it a simple language. That's neither true for developers
nor users of the language.
PHP now is multi-paradigm language (isn't it), so... yep, that's the same
:)
1) Makes language harder to maintain as there is more (and more complex)
code implementing it.
2) Makes documentation bigger so users have first to figure out what
part to read and what part to ignore.
3) Makes it harder to write portable user-land libraries as the
application and the different libraries might use different (clashing)
paradigms. See error codes vs. exceptions as an example of this.
4) Makes it harder to have extensions like APC as they have to implement
more features.
5) Makes it harder to write alternative implementations.
All this points are also applicable to namespaces, [abstract,final]
classes, interfaces, traits, access modifiers (instead of using `var`),
etc.
If you would have said, this points in the context of... say... necessity
of that feature, then yeah, maybe you would be right.
Anyway, as long as almost no one didn't supported, I think we can close
this discussion.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php