Hacker News new | ask | show | jobs
by dagw 2038 days ago
Modern PHPs shining light is the Laravel framework and the ecosystem built up around it. If you're going to start a database-driven website projects in PHP there really isn't a good reason to not use and learn Laravel (or Lumen if you want something more lightweight).

That being said if you're not tied to PHP I'm not sure I'd necessarily recommend it. The obvious alternatives worth looking into are Ruby on Rails or Python with Flask or Django.

4 comments

> PHP there really isn't a good reason to not use and learn Laravel (or Lumen if you want something more lightweight).

12 year professional PHP developer (in that it's been my main language, I've also written a lot of C# and TypeScript in that period) - I'd pick Symfony for any project I knew was going to last more than a few years before the inevitable re-write.

The problem is you don't see the difference until you've seen multiple large codebases implemented in both frameworks.

Symfony is harder to bootstrap a project with (though not really that true since 5) but in nearly every other way it gets more right than wrong.

Laravel is good and bad for the ecosystem at the same time. I've interviewed a lot of people lately who know laravel but not php. Similarly to people who claim they know react but fail in the most basic js questions.
Additionally Laravel abuses patterns like singletons and in general static methods. This is really a no-no for modern PHP, in my opinion. I think Symfony had a way better impact on the ecosystem.
To be fair, Laravel’s facades look like static method calls, but they’re actually not. They’re backed by the service container and can be swapped out for mocks etc just as easily as injected dependencies. They’re also totally optional, and in general are falling out of fashion within the community.
I could just never get used to Ruby syntax and how wordy it is.

PHP/C/perl-style syntax just feels much nicer/more natural to write and I've never been able to break out of that.

I guess it comes down to personal preference and what you started coding with.

Ruby "wordy" compared with PHP? You have to be joking. PHP is pseudo-Java in terms of verbosity. It's even worse than Java with its culture of space-wasting blank lines and fanfold doc comments.
Is Laravel better than Symfony? When I used PHP, the Symfony components were the best in the ecosystem.
"Better" is relative. Laravel is built on top of Symfony components FWIW.