r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

2

u/dagguh2 Dec 02 '15 edited Dec 02 '15

PHP is completely changing their philosophy at least since version 5. Before it, PHP was a duck-typed language for creating home pages. It was perfect for its purpose, because it was easy, quick and dirty.

At some point, people started using it for full-blown applications. PHP maintainers decided to support these mad men and they've started transforming PHP to meet their needs. They're trying to make it look like Java, abandoning every original PHP design principle. It took years and it still cannot be even compared to Java, feature-wise and ecosystem-wise. It's a sad, pointless struggle.

65

u/[deleted] Dec 02 '15 edited Dec 02 '15

They're trying to make it look like Java, abandoning every original PHP design principle. It took years and it still cannot be even compared to Java, feature-wise and ecosystem-wise. It's a sad, pointless struggle.

The original PHP design principle was for it to be a basic template engine exposing C++ services. Things change in 20 years, who woulda thunk.

As for design principles "abandoned" since 5.x, I'm curious to hear what they are.

The renewed interest in dynamic languages that have optional typing and statically verifiable invariants is hardly unique to PHP. It's an industry trend. TypeScript is wildly popular in the JavaScript community. Python is getting typehints. Dart comes with typehints out of the box.

All dynamic languages are moving to have more static features, and all static languages are adding more dynamic features.

It's a normal process of convergence, and I agree it's a "struggle", but it's not a pointless one. We get better, more well-rounded languages as a result, which are more efficient and pleasant to work with, for a wider range of projects.

0

u/[deleted] Dec 02 '15

[deleted]

6

u/[deleted] Dec 02 '15

Has them, actually (since 3.5). mypy has been around a lot longer.

Neat, I didn't realize it's out of the gates.

To be honest I'm surprised it took people this long to add some semblance of typechecking to these languages.

Likewise. It was a pointless controversy IMHO as maintainers of dynamic languages felt that having typehints, even optional ones, is somehow ceding ground to static languages like Java. I've seen this attitude with Python, and with JavaScript coders who frowned upon TypeScript.

While it's not the case, as you can always strategically remove a typehint somewhere and do a dynamic runtime check on the type when you need it, still using the script's runtime dynamic typing capabilities to their full extent. But such uses have always been more of an edge case than a rule in any larger project.

I'm happy how languages are evolving. We're finally finding a nice balance between runtime and static.

→ More replies (3)