3 ms·
> and it's clear that this stuff is shoehorned into the language and good use of these features is not ingrained into PHP culture. Every major PHP framework us
by debaserab2 14y ago
> and it's clear that this stuff is shoehorned into the language and good use of these features is not ingrained into PHP culture.
Every major PHP framework uses both namespacing and closures.
> The ruby OO model with its mixins, implicit metaclass (eigenclass), and dynamic nature (ie. class definitions are just executable code), and standard functional features like lambdas w/ closures are all designed into the language in a very elegant way and this basic model has been more or less stable for the nearly 20 years of ruby's existence.
What you're describing here is the difference in the language itself. The PHP OO model is more traditional and Java-like, but that doesn't implicitly make it worse or behind the times.
> However if you look at the corpi of popular open source ruby code vs popular open source PHP code over the years, you find a much higher bar of quality in the ruby code.
I can't speak for the Ruby side, but on the PHP side you couldn't be more wrong. The open source efforts in PHP in the last 5 years have been nothing short of excellent. The open source PHP community has completely adopted the full range of PHP features, unit testing (TDD and BDD), and coding standards (https://github.com/php-fig/fig-standards/tree/master/accepted https://github.com/php-fig/fig-standards/tree/master/accepte...). This is nothing new and it's been like this for a while.
- dasil003 14y ago> Every major PHP framework uses both namespacing and closures. No True Scotsman argument. > The PHP OO model is more traditional and Java-like, but that doesn't implicitly make it worse or behind the times. I don't care for fashion, so "behind the times" is neither here nor there, however a Java like OO model is definitely worse on most axes except foot-shooting and style-uniformity for large teams. If I want strong typing I want a system that leverages its power such as Haskell, not something like Java where compilation errors are mostly trivial things and I still end up with null pointers all over the place which is exactly the same as the most common type of error in more powerful dynamic languages. Beyond that, saying PHP OO is like Java is doing PHP a huge service because Java started out as OO with quite a strong vision. It may not have been perfect, and it's certainly developed its warts over time, but the seed of conceptual integrity in Java's OO is an order of magnitude more robust than PHP's. > I can't speak for the Ruby side, but on the PHP side you couldn't be more wrong. I was specifically making a comparison between PHP and Ruby. Making a one-side claim is a nonsensical response.
- debaserab2 14y ago>No True Scotsman argument. Kind of, but not really. The two major framework players in the PHP space right now are Zend Framework 2 and Symfony 2. This isn't really a "No True Scotsman" argument because both are headed up by reputable development shops (Sensio and Zend). Both use namespaces. > I don't care for fashion, so "behind the times" is neither here nor there, however a Java like OO model is definitely worse on most axes except foot-shooting and style-uniformity for large teams. If I want strong typing I want a system that leverages its power such as Haskell, not something like Java where compilation errors are mostly trivial things and I still end up with null pointers all over the place which is exactly the same as the most common type of error in more powerful dynamic languages. Beyond that, saying PHP OO is like Java is doing PHP a huge service because Java started out as OO with quite a strong vision. It may not have been perfect, and it's certainly developed its warts over time, but the seed of conceptual integrity in Java's OO is an order of magnitude more robust than PHP's. Err, what? I'm not sure if I'm misunderstanding you here -- because PHP didn't have OO designs early on somehow that makes it's OO model less robust then Java's? I'm not going to bother arguing that point, but it certainly doesn't make me a less efficient developer. PHP's OO model is more than adequate for most web applications. I'm also not following the null pointer issue. Proper unit testing should vet null value issues out whether you're using a dynamic language or not. PHP has the (arguable) advantage of not completely shutting down when this mistake occurs. > I was specifically making a comparison between PHP and Ruby. Making a one-side claim is a nonsensical response. Not anymore of a one-sided claim than your own. You haven't done a lot of research into what's going on in the "popular open source PHP code" if you think your opinion is two-sided -- I'd strongly challenge you to point out what popular modern open source PHP code is inferior to popular modern open source ruby code.