5 ms·
htmx is one of those things, like SQLite on the server, that you will incessantly see on HN, but rarely see used at large profitable companies. Say you use pyt
by endisneigh 3y ago
htmx is one of those things, like SQLite on the server, that you will incessantly see on HN, but rarely see used at large profitable companies.
Say you use python and Django. Why use htmx instead of Django templates? Same with ruby and rails, elixir and phoenix, etc. the trend is clearly towards live view/hotwire OR things like server side react. Htmx is in a weird position that makes no sense unless you want to use it for the sake of using it.
- unsupp0rted 3y agoPeople use it for the sake of not using JavaScript. To a React client-side developer everything should be done in React on the client-side, with maybe a sprinkle of backend for unavoidable things, like where API keys live. They’ll foot-gun as much backend stuff into the front end as possible. To a certain kind of backend developer, everything should be done typesafe in non-JavaScript on the backend, with a sprinkle of client-side JavaScript for unavoidable things like showing/hiding elements. Of course even for this, 10 lines of CSS is preferable to 1 line of JS. They’ll foot-gun as much client-side stuff into the back end as possible.
- karmarepellent 3y agoMaybe some people are using it to avoid JS at all costs. I am using it to have everything (validation, authentication) in one place, the backend. It also saves me currently four serialization and deserialization steps, which drastically improved performance. meanwhile there will also be a few 10s or 100s lines of JS to enable some specific behaviour that I do not want to (or would be awkward to) implement in HTMX. I am not saying that it is a silver bullet and people may use it for a variety of reasons, even avoid JS. I try to be less biased and make the best of both worlds. Until now, it has been pure joy.
- philipwhiuk 3y agoHappy full-stack React + Back-end guy here :)
- dizhn 3y agoThis is not necessarily refuting what you said but perhaps a different point of view. I wrote a simple backend servive with go and wanted to have some on off switches and status icons for it. I don't know js and am not interested in learning it. Htmx gave me enough interactivity to put together that one status thing with buttons in a few hours. To me that's valuable.
- giraffe_lady 3y agoIf we're judging by things I've seen at profitable companies the past, present and future is php.
- resoluteteeth 3y ago> htmx is one of those things, like SQLite on the server, that you will incessantly see on HN, but rarely see used at large profitable companies. This is true. However: > Say you use python and Django. Why use htmx instead of Django templates? This doesn't make sense and makes me think you might be confused about what htmx is. The purpose of htmx is precisely so you can just use things like django and render pages on the server but still make a website feel more like a modern website by replacing elements without having everything require a whole page reload and without having to write your own javascript code. That said, I personally think there are reasons why approaches like what htmx does fell out of favor.
- endisneigh 3y agoI understand this, but my point is all the major frameworks have their equivalents to Hotwire, which don’t require you to even use JavaScript at all.
- resoluteteeth 3y agoI don't understand what you mean. Hotwire uses javascript internally just like htmx does and neither require you to write your own javascript. I'm not aware of django including a similar library, so if you want to take this approach with django I think you need to use htmx, but my impression is that hotwire and htmx are fairly equivalent.
- metaltyphoon 3y agoBecause just like ASP Razor templates, you still need to write JS for anything basic and with htmx you can get to 80/20.
- sodapopcan 3y agoThings need time to take hold while people unlearn what they thought was "law". Python had its time of being "the new hipster language" (in whatever disparaging vernacular we used back then, I'm too old to remember)
- yoyohello13 3y ago> Why use htmx instead of Django templates? HTMX is meant to be used WITH backend framework templates. The point of HTMX is it allows you to use your backend templating system to return pieces of HTML instead of JSON. We are using it at our org for our intranet applications and it's been great so far.
- endisneigh 3y agoI understand that, but why? You can write the entire thing in Django alone and use Hotwire and not use any JavaScript to begin with.
- mring33621 3y agoI would say that Hotwire is somewhat a competitor to htmx.
- mring33621 3y agoI did a little POC for myself for an internal app that provides pass-thru access to a menu of tools (most of which are java-based microservices) and I'm using Django templates to deliver content to htmx-controlled slots in the UI. Works great and is very easy, from someone who is not an expert in either tech. Overall, I have used htmx successfully in several small projects, of varying tech stacks, without much effort at all.
- zilti 3y agoHTMX doesn't replace any templates, that is not its purpose. And trends are usually a great indicator of what not to do.
- AzalinRex 3y agoif we go by precedent, every single thing that we were told was good because it was a trend has lasted less than a year and had to revamp and mutate itself out of a supposed position of streamlining and simplicity. A lot of the supposed positives of certain "technologies" that we were told were key factors to embrace several tech have been proven to be false, and yet the cultists of the endless rotation of frameworks want us to stop listening to anyone asking "huh, isn't this like... super dumb?"
- deleted 3y ago[deleted]