19 points · by BerislavLopac · 4y ago · 14 comments
I feel like too many developers never venture out past javascript and it shows. different languages highlight different ways of approaching and solving problems and I look forward to how that will play out.
Or am I thinking of this incorrectly? This is the first time I've investigated a solution of this type.
It’s a shame we didn’t make better use of our time solving the problem before the JS posers did their horrors by pretending that the solution was to take front end languages and code the backend.
Ecto (the ORM in Phoenix) seems like it should have all the parts for automatic migration generation but it's just the last little step missing.
I do like a lot Livewire, Hotwire, Unpoly, HTMX, etc... but using these tools (or any backend language compiled to wasm, etc,etc) as a way to try to avoid JavaScript is never going to work and will only cause pain and terrible applications.
Even with those HTML first technologies (which I like a lot) you need to learn to accept JavaScript is just another tool and one that you will definitely need to learn and use to make anything decent.
It is great to have a framework such as livewire that when you click a button to "load more" will render the new items in the backend and just swap out a placeholder and done. No JavaScript, no API, etc. Amazing.
It is just *terrible*, flaky, unresponsive, overkill and absurd to reach for the backend to re render a bunch of html because you needed to toggle a class or hide a box.
Use the right tool for the job.
I'm really tired of backend developers hating on JavaScript the same I'm tired of JavaScript developers hating on PHP, etc, etc.
Different tools. Different tasks. Let's not try to be purists and "JavaScript all the things" or "I'm not touching JavaScript because it sucks".
This is a strawman. I never claimed one should use Liveview for all web work. I'm just saying people _want_ to do web stuff with languages other than javaScript. javaScript is only "the right tool" in the sense that it's the only one that's native to the browser. If they substituted javaScript with any of the other popular general purpose languages no one would be any worse off for it (not factoring in the ecosystem built around it). javaScript doesn't have any features that make it better suited for the web than other general purpose languages. It's _only_ real advantage is that years ago a decision was made to create and use JS (edit: ..in the browser) and we've all been stuck with it since.
Please don't create accounts to break HN's rules with.