What really sucks about PHP though is that most of the quality code lives inside frameworks. While it's rather easy to include parts of Zend Framework in your own code/other frameworks (it almost always comes with some bloat due to dependencies though), nearly all other frameworks' parts are impossible to 'extract' and re-use them elsewhere.
Every time I read about a new useful and slick Ruby gem that's properly tested and can be used with or without every available Ruby framework, it's making me sigh.
I wish the PHP world was like that as well and people would just build more 'libs'. If you're stuck on a PHP version below 5.3, you won't even find a powerful implementation of ActiveRecord. And no way I am going to include a bloated powerhouse like Doctrine in a project that basically only consists of five to ten files when I am only looking for a convenient way to do some basic CRUD stuff.
Don't get me wrong though, PHP has been my primary programming language for the past years but the lack of good libraries that you can just use and drop in is really a problem. And the ones that are available are hard to find, hidden away in random blog posts and github repos.
When I'm coding and hit some need like CSRF protection, I think, "I need a library to do CSRF protection," not, "I need to switch to a framework that includes CSRF protection."
Unfortunately, there's not a good mechanism like RubyGems for distributing/discovering PHP libraries. PEAR isn't it. It has too much stuff that's either unmaintained or dangerously unstable. I don't know what happened there. Maybe the coding standards and general bureaucracy involved in creating PEAR packages drove out innovation.
I haven't had a serious look around the PEAR libraries in ages, mainly because I don't want to have classes like their own 'Error' class around in my code at all.
Regarding distribution I was hoping that .phar files would become the new standard but I haven't seen a single .phar file around. Definitely agree that a central place to discover libraries is really needed as well.
What really sucks about PHP though is that most of the quality code lives inside frameworks. While it's rather easy to include parts of Zend Framework in your own code/other frameworks (it almost always comes with some bloat due to dependencies though), nearly all other frameworks' parts are impossible to 'extract' and re-use them elsewhere.
Every time I read about a new useful and slick Ruby gem that's properly tested and can be used with or without every available Ruby framework, it's making me sigh.
I wish the PHP world was like that as well and people would just build more 'libs'. If you're stuck on a PHP version below 5.3, you won't even find a powerful implementation of ActiveRecord. And no way I am going to include a bloated powerhouse like Doctrine in a project that basically only consists of five to ten files when I am only looking for a convenient way to do some basic CRUD stuff.
Don't get me wrong though, PHP has been my primary programming language for the past years but the lack of good libraries that you can just use and drop in is really a problem. And the ones that are available are hard to find, hidden away in random blog posts and github repos.