Live data from Hacker News

In many ways PHP is just now starting to come into its own

gist.github.com

131–133 of 133 posts

Re: In many ways PHP is just now starting to come into its own

#131
post #130
post #108

Earlier quoted context omitted.

With templating systems which 'compile' templates down to php anyway, that might be a distinction without a difference.

Fair enough. I know Smarty does this and caches the PHP-ized version. I guess the difference could come from how efficient the template-to-PHP compilation is, but I bet you're right and it's trivial in most cases.

Twig too, and you can sandbox functions and auto-escape data. To me, using templates is more or less the same as using a framework with PHP -- it does add overhead and you could get by with, say, plain PHP and having urls point directly to resources but sometimes I think the benefits of that extra abstraction, even if it is a bit recursive, outweigh the potential costs of not having logical buffers between a request and its execution. An app that's too dumb can come back to bite you just as hard as one that's too clever by half.

Blade (used by Laravel) seems to be more along the lines of "bare PHP/bind to PDO object" but I haven't studied it too hard because i'm such a twig fanboy.

Re: In many ways PHP is just now starting to come into its own

#132
post #101
post #23

I wish people would stop trying to defend PHP against "the haters" - firstly because no amount of reasoned argument is going to change the views of fundamentalists, and secondly because they are a minority group whose opinions are unlikely to inhibit the rise of the PHP ecosystem.

I would argue that the "rise of the PHP ecosystem" has been massively damaged by the amount that has been written about PHP's flaws. An ecosystem needs talented programmers working on open source libraries for that ecosystem, or helping spread best practices. You don't see much fresh innovation in the PHP community these days - instead, you see developers who work with PHP having to recreate libraries and techniques…

I'd take issue with arguing that there isn't much innovation in the PHP community.

It might not be the best language for every application (I find myself using it less and less these days), but there have been a whole ton of recent developments that have made it much nicer to work with.

PHP 5.4 made some pretty significant improvements, and Laravel is one of the nicest full-stack frameworks I've ever worked with. PHP now has good/sane dependency management via Composer, and many of Laravel and Symfony's components can now be used outside of the main framework. Microframeworks are a pleasure to work with in PHP, which is especially nice for smaller one-off webapps.

Many of the recent improvements have been (very) late to the game, but they're nevertheless welcome. I could do without the Java-esque levels of verbosity that PSR-0 encourages, but it does seem to result in highly-maintainable code.

"New PHP" projects (written from scratch, targeting 5.3 and above) tend to be of surprisingly high quality. As I've mentioned before, Laravel emerged from nowhere as a lightweight and very high-quality framework, long after the PHP community had been declared moribund.

Re: In many ways PHP is just now starting to come into its own

#133
post #118
post #116

Can anyone recommend a good PHP framework? I've used Zend and Yii - they are okay, but I'd like to try something new. So, other than these two, which ones are good?

Laravel 4 http://laravel.io for large dependency heavy projects, Slim Framework http://slimframework.com as a microframework.

Many of Laravel's components can also be stripped out and used as microframeworks. Their database ORM is particularly nice, and I use it alongside Slim on a few projects.

From my experience using it, Laravel also feels a lot "lighter" than the other big frameworks of the past. It's a bit less opinionated, and it's much easier to get set up and running.

Post reply on HN