Live data from Hacker News

Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

getludic.dev

21–30 of 39 posts

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#22

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

This is to me a non starter. Why does the server care what that im incrementing the local data? None of that is likely important until I am done.

This is just one more layer on top, and one more possible point of failure/frustration, as illustrated by this parent comment.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#23
I'm just never going to understand why you'd want to write your HTML in something unlike HTML (Python in this case). Then you need to know the thing that isn't like HTML, plus HTML, plus the details of how the other thing is transformed to HTML.

Of course, we often need something dynamic, so we can't just use HTML. But why not something a lot like HTML so those additional pieces are as small and simple as possible... you know... like a template engine.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#24
post #23

I'm just never going to understand why you'd want to write your HTML in something unlike HTML (Python in this case). Then you need to know the thing that isn't like HTML, plus HTML, plus the details of how the other thing is transformed to HTML. Of course, we often need something dynamic, so we can't just use HTML. But why not something a lot like HTML so those additional pieces are as small and simple as possible...…

Templating engines start out with just variable substitution, but inevitably you want to build logic into your HTML, so it adds if/else statements, then before you know it you are embedding your 'real' programming language into the HTML template itself. Think ERB templates with arbitrary ruby code inside them.

It's more robust to go the other way: start with the full-powered programming language, and emit the static HTML data after doing the complex logic stuff.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#25

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

This is to me a non starter. Why does the server care what that im incrementing the local data? None of that is likely important until I am done. This is just one more layer on top, and one more possible point of failure/frustration, as illustrated by this parent comment.

Because you're incrementing server side data, not local.

Which doesn't matter for trivial counter examples but the same technique is something I've used (not with ludic, but with HTMX) to trigger actions in physical space.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#26
post #23

I'm just never going to understand why you'd want to write your HTML in something unlike HTML (Python in this case). Then you need to know the thing that isn't like HTML, plus HTML, plus the details of how the other thing is transformed to HTML. Of course, we often need something dynamic, so we can't just use HTML. But why not something a lot like HTML so those additional pieces are as small and simple as possible...…

Because HTML is not a programming language, but you do have problems which demand a programming language, and this "something" is the programming language you know. HTML is just a mean to reach their goal. People are usually not writing json or xml by hand either.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#27

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

No. It's fast, but not immediate. It's annoying but not unusable.

Worse though, it starts dropping repeated clicks. Triple click increments counter by 2. Unfortunately, this is unusable.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#29
post #13

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

Totally depends on your latency to the server and server response time. Please don’t throw away two decades of client side advancements and do this for state changes that should be entirely local, people with higher latency will hate your guts. Use alpine or something like that if you don’t want to go full react/vue/svelte/solid/etc. It’s utterly terrifying that I now see this pattern evangelized every day. As an asi…

I've been following projects like Hotwire and HTMX for awhile now, and I haven't seen anyone argue that scraping is a major reason to adopt this approach. I also don't see a lot of opposition to the idea of incorporating something like alpine to add some UI niceness.

What you see as a "terrifying" disregard for "two decades of advancements", others see as a liberating departure from two decades of unnecessary bloat. It's healthy to have more than one strategy available for building web applications.

Re: Show HN: Web Development with Htmx, Type-Guided Components, Pure Python

#30
post #13

On a reasonably fast connection, I hit the increment button and it took almost two seconds for the counter to increment. Is it immediate for everyone?

Totally depends on your latency to the server and server response time. Please don’t throw away two decades of client side advancements and do this for state changes that should be entirely local, people with higher latency will hate your guts. Use alpine or something like that if you don’t want to go full react/vue/svelte/solid/etc. It’s utterly terrifying that I now see this pattern evangelized every day. As an asi…

I guess you're not a LiveView fan then?
Post reply on HN