Hacker News new | ask | show | jobs
by chiyc 1652 days ago
I was similarly motivated to go with PHP and Laravel instead of Node for a personal project recently. Does anyone with experience in both Laravel and Rails have thoughts on how they compare? Both the frameworks themselves and the surrounding ecosystem?
1 comments

I can comment vs Django:

Laravel:

- no admin (although there are good free projects like filament admin)

- not well defined models

+ queues builtin

+ task scheduling builtin

+ livewire builtin

+ webpack builtin (this saves a ton of time as if you have a problem someone else likely has had it as well)

+ builtin relatively sane api framework (although the inertia integration for things like Vue, seems to almost encourage exposing more data than you mean to, I see this a potential data leak vector with unexperienced developers)

+ composer is way better than poetry/pip/pipenv/ whatever

+ first party support for many things you'll need (Payments, Browser testing, Hosting, Docker development, etc)

+ cheaper developers

+ Laravels facades such as Collection, Arr, Str remove many of the warts of PHP and in some cases can make some manipulations almost as concise and readable as Python

+ Laravel seems to monetize things better which imo is a path to sustainability.

+ Encourages use of modern css frameworks / javascript frontends.

Django:

+ admin (although dated looking and very hard to sell for client facing admin stuff, as it will never look like they want it to), honestly maybe the best admin out there for speed of setting up etc.

+ better models with db columns defined in model, could use typing though.

+ way better documentation

+ python's better more concise syntax on most things

+ fully automatic migrations (although you will eventually run into issues here, with good practices can work very well)

- python packaging in a horrible state

- too many basically essential packages not in core (api, queues (even database based queues))

+ python packages for basically anything out there somewhere

- Django rest framework (this project was okay for its time, but it is seriously dated, and takes the air out of some better projects such as django-ninja)

Having some experience with both, agree with everything you said.

I'd also add Django is great if you're building only a backend with it (and you have no frontend and/or it's an external SPA).

For full stack development, Laravel all the way. Just it's templating system (blade) is a joy to use compared to Django's templating system which feels stuck in the 90s.

Just want to say thanks for mentioning django-ninja. I hadn't heard of it. It looks exactly what I've been wishing was out there. Django is just so good, but the lack of type hints make FastAPI super attractive, so django-ninja seems to have found quite the sweet spot.