3 ms·
This still conflates language with platform/framework. There's a reason PHP is big and Symfony is small - only a fraction of the PHP users have needs that are
by mgkimsal 15y ago
This still conflates language with platform/framework. There's a reason PHP is big and Symfony is small - only a fraction of the PHP users have needs that are met by symfony and have the time/effort to learn symfony in the first place.
There's actually probably multiple reasons, but that's the easiest one off the top of my head. PHP's used in all kinds of web places that Ruby isn't, mostly because Ruby's not a great fit in those places.
Hello <?=$name;?> it's <?=date("h:i:s");?>.
I've never met anyone who does 'ruby pages' and drops ruby in to various files as needed for small stuff. You can do that and many people do with PHP.
All web work I've ever seen done in Ruby uses Rails or Sinatra or some framework. Only a portion of web work I've seen in PHP uses any community framework. This is just the way it is.
Your point on ecosystems is correct - the ZF system is probably the closest modern one out there (indeed, ZF should have been called PEAR2 years ago) - Symfony uses bits of ZF libraries as needed. But because of the naming, people think you use all of it. Because Rails was/is the dominant web framework in Ruby for so long, it feeds on itself, and people end up writing cool stuff for Rails, and more people use it because of the cool stuff, lather rinse repeat. The cool symfony stuff mostly can't be used outside symfony, CI stuff not usable outside CI, etc.
There's some cool stuff in Grails I use - it's not possible in PHP (maybe in the future if the language changes) so I use Grails when need be (or when I feel like it). No amount of libraries/frameworks in PHP will make up for the missing language features, and this is the heart of your last paragraph (which I agree with). I still use PHP for a lot of stuff, but have expanded out to other tools that fit other use cases better.
I do wish I'd see other camps being as broadminded as they exhort PHP users to be, though. By and large, there's stil loads of people that try to do all their projects in Rails, or J2EE, or .NET, or Django, or whatever. PHP's got its place, and sometimes really is the best choice for a project. Ultimately, there's still loads of fanboys out there in all camps. :/
- eropple 15y ago> Only a portion of web work I've seen in PHP uses any community framework. This is just the way it is. This is not a good thing! It's one of the biggest reasons why the overall state of PHP development, @fabpot and friends excluded, is absolutely terrible.
- jasonlotito 15y ago> It's one of the biggest reasons why ... One person having limited experience with professional PHP development doesn't make it the overall state of PHP development. The majority of PHP development I've see use these community frameworks like Zend and Symfony. They also use a lot of other well established tools. Things like CodeCoverage and PHPUnit, xdebug, and countless other solid, well written tools. I'm sorry, but when people refer to PHP development and relate to WordPress or Drupal, I can't help but shake my head. If that's your idea of professional level PHP, I'd hate to see what you think professional level code in your language looks like. The overall state of PHP development is doing well. We have a lot of professionals writing solid code. Yes, we have a lot of people that flock to WordPress and Drupal, or pick up CI and think they are following best practices in PHP. Many move off to a framework in another language, thankful to get away from PHP and the horrible code it forced them to write.
- eropple 15y agoFor quite a long time I was a PHP guy. I've used pretty much any PHP framework you'd care to name. I rolled my own unit test framework before PHPUnit even existed. I was using DBG when xdebug was launched. I was patching PHP to use FPM long before it was in core. Believe you me, I am entirely too familiar with PHP and the ecosystem around it and I wouldn't go back in part because tools like xdebug really are that bad in comparison to what you get with something like Scala or .NET. The problem is less the language, which is slippery and broken in interesting and different ways from version to version but generally not in ways that are real killers. The real problem is that those people that you say aren't professional developers (and they're not!) and are considered important use cases. This is a language where the core developers actually care about people who splat HTML in their PHP and vice versa. They're the people who don't even know about mysql_real_escape_string (LOL), let alone PDO or doctrine-dbal. And if those guys are just hanging on, great, more power to them, but the core PHP team actually cares about the use case for these people, while for the most part, they really don't seem to care about the use case for people who want to Do It Right. The distaste from guys like Rasmus toward the various framework projects is well-known and I kinda think it has an impact on the language itself. This is I've seen as commonplace PHP development: -Misuse of Mediawiki as a corporate intranet, using and extending scary plugins like template parser functions. -Autogenerated CakePHP monstrosities that barely function and doesn't if you have to make significant changes. -Home-rolled extensions to Drupal for that one little thing that SomeCo's website really just had to have. Ditto Wordpress, ditto Joomla. Don't get me wrong: it is entirely possible to write good PHP. I'd say, with a decent bit of conviction, that the possibility of doing so goes down sublinearly with the amount of code/feature-points/other-measure-of-size and goes down superlinearly with the number of other people touching your code. But it's totally possible to do so. I wouldn't have used it for most of a decade if it wasn't. But I am entirely and completely convinced it is the sad minority, with the crazy majority largely catered to by the PHP development team, and it's a major reason why I've gone on to saner pastures.