Hacker News new | ask | show | jobs
by midrus 1618 days ago
I'm one of those web devs that tries everything under the sun, and I also happen to have worked for a lot of companies (more than a dozen already, I'm on my 40s).

Laravel is such a *joy*. I've never had this feeling of using something so easy and productive. I've been recently building a side project with LiveWire and oh-my-god. I really wish I had discovered it before. From the templating system (you get components out of the box! no more "includes" if you don't want to) to the validations, to the queues system... everything is so well integrated and so easy to use.

For the last decade I've worked mostly with Django and SPAs, I'm not going back to that any time soon. Django templates are extremely limited for nowadays requirements, and SPAs are 1000x more complex to build and maintain so in my opinion they're not worth the price/effort. I think Livewire, Hotwire, Unpoly, Htmx, etc are what 90% of web apps need.

2 comments

Laravel and Livewire is the best-kept secret ever because everybody is too busy being biased against PHP.
Php/Laravel/Livewire == Elixir/Phoenix/LiveView == C#/.NET/Blazor == Ruby/Rails/Hotwire/Turbo

It's also slowly being integrated into JS frameworks although they're still behind as the focus has been clientside and static generation so far.

== Everything else/HTMX. Well currently HTMX is still a "low level" clientside library, but in a similar vein to Ruby/Rails/Hotwire/Turbo.

Feels like BE-first dev and non-SPA/JS centric client webdev is slowly regaining ground. Exciting.

I've found Unpoly to be a nice middleground between those framework specific solutions and htmx
Or we're too busy using Phoenix LiveView ;P
One of the companies I worked for used Elixir/Phoenix. It is an extremely cool piece of tech but it is nowhere near as productive as Laravel, Rails, etc. Missing libraries, difficult to hire for, bad editor support, and overall feels very niche which such a small community. That company eventually moved out of it.
Hey, that's why we need more people! It's getting better and better all the time. And nothing really beats its ease at making conncurent web apps. But yes, if you're an IDE person, you're going to have a bad time and that is not likely to chnage any time soon (I don't think?)
Or Rails/Hotwire.
I like Laravel, but i don't like Livewire that much. Livewire is really neat when building simple interactive stuff, but when building larger more dynamic parts it gets pretty sluggish and the livewire component codebase starts to feel harder to maintain.

Last time I tried to use Livewire with Vue, it had some issues which caused Vue to lose reactivity. (Maybe Livewire removed the DOM where the Vue instance was rendered. There was some options that prevented livewire from replacing elements with given id/classname.) But if i remember correctly, you cant have livewire element which has vue components as child elements.

Maybe i was doing stuff wrong or the livewire<->Vue compatibility is a bit better nowadays. Or maybe its because I'm too used to Vue.

It felt like the Laravel community jumped to the Livewire hypetrain quite fast and it feels like the livewire recommendation to use alpinejs in someparts is required. And most of the examples for alpinejs requires you to write inline code. (It is possible to split the code to own js files, but then again you are building something that gets closer to Vuejs.)

It feels weird to recommend to write scripts using inline javascript. That requires more CSP modifications for security and also the scripts wont get cached and are loaded every time the page loads. (If I'm correct.)

TL;DR Livewire is great for small features.

I think livewire works better with Alpine. Also, I think Livewire is great for interactions that require a backend request (such as posting a comment, refreshing some data, etc). If an interaction can be performed without reaching for the server, then Alpine is a better option.

In my opinion, when everything breaks down (and not saying this is your case, just what I think) is if you try to do every interaction with Livewire (thus reaching for the server when you shouldn't) or when trying to mix in SPA tools (such as Vue, React, etc...) with it. I suppose you'll end up with the worst parts of every solution.

Did also plaid with Ruby on Rails, or even Sinatra, and how would your rank the dev XP compared to Laravel?
I did use Rails for several months while helping a friend with his business/sideproject/startup kick-off and despite I really liked it, I much prefer Laravel + Livewire and PHP (https://tallstack.dev/) over Rails + Hotwire + Ruby, but it's up to personal preferences:

- I prefer things to be more explicit than implicit and lean more towards configuration over convention.

- I lean more towards having types/typing information than not having it

- PHP is way, way, way more used than Ruby

- Performance (just talking about development environment performance) is a lot better in PHP (no server restarts, etc)

- Availability of third party libraries is a lot stronger on the PHP side, probably due to it being more popular

- Tooling and editor support. This is a big one for me, and I've found out things to work a lot better with VSCode for PHP than for Ruby. Probably related to it being both, more popular and more explicit.

- Overall, Laravel feels even more complete than Rails and just fits better my brain.

But, I think Rails is still great, and I would use it over building a microservices mesh of Go servers on kubernetes with React frontends, etc, etc.

I'll take Rails over Laravel any day. Verbose, doc-block-riddled, pseudo-Java PHP is the polar opposite of elegant, composable Ruby.
Well, probably you are right, but for me ecosystem, libraries, tooling, editor support, performance, etc is far more important than language syntax. But we all have our preferences and that's ok.