Since there's a heavy debate on the list about strong typing right now, I
just want to briefly share my point of view.

PHP is not and won't be a strongly typed language. What it can be (and is
on the way to be, with Clint's work) is a language that supports
type-checking. Not the same as strongly typed.

There's a time for unchecked properties and arguments, and there's a time
for type-checking - you can argue against type hints and type-checks until
you're blue in the face, but they exists for a reason: static analysis,
which means better tooling and faster (and more well-documented) codebases
in larger projects. And early warning systems - making sure that code fails
at the point of failure, rather than bad arguments (or worse,
property-values) slipping through the cracks, costing you many hours of
painstaking debugging. Code that doesn't fail in the place where it's
actually broken, is harder to debug than anything else.

Type hints are optional, so PHP can still be a beginner-friendly language.
To classify PHP as a "beginner-language" seems unfair to experienced
professionals, who brought projects like Symfony and Zend Framework to
life. The recent injection of new talent and renewed interest in the past
1-2 years has happened because those people stuck with PHP rather than
"moving on" to other languages - let's face it, nobody wants to be stuck in
"beginner mode", and if PHP was really strictly a "beginner language", it
would be largely a waste of time. To me, it is much more than that - it is
a language where you can dip your toes and test the water safely, but you
can go really, really deep if you want to.

The modern tools, libraries and frameworks available today are
a testament to that fact - if the people behind these projects had simply
"moved on", where would PHP be today?

Growing the language is key to maintaining the interest of smart people who
are willing to invest their time in building great software with PHP and
sharing it with the community. A language is only worth as much as the
community is willing to invest!

Don't be afraid of scaring off beginners with advanced features - because
PHP is such a loose language, those people can still get on board and start
learning, without having to go the whole way on day 1. Beginners are
unlikely to start picking apart Symfony or Zend Framework anyhow - but they
are likely to start trying them out eventually. Most people do not get into
PHP development intending to learn only the basics - they usually have a
more long-term plan. Those who get in, intending to learn only a little,
are usually designers and front-end people, who will never touch more than
a view/template script anyhow, and thus will never even encounter classes,
closures, or any of the other "advanced" stuff.

Just my two cents.

Reply via email to