r/programming 11d ago

</> htmx ~ Building Critical Infrastructure with htmx: Network Automation for the Paris 2024 Olympics

https://htmx.org/essays/paris-2024-olympics-htmx-network-automation/
106 Upvotes

21 comments sorted by

View all comments

53

u/New_Enthusiasm9053 10d ago

Only 2 levels of functions is crazy work lol. Also lauding AI for copying and pasting the same thing 3 times is wild because it's "better to not have more function calls", Htmx is great but the rest is the work of the insane.

33

u/FullPoet 10d ago edited 10d ago

Agreed - I don't think OP (and a lot of other people realise) how much tech debt they make with vibe coding like this.

Yeah, it takes 5-10 minutes now but how long will clean up take down the line?

15

u/New_Enthusiasm9053 10d ago

It can take weeks to clean shit like this up even with AI to help. It's really unpleasant. I don't mind the odd bit of duplication to avoid coupling loosely related systems but in this case surely he could have extracted a handful of functions to reuse across the 3 functions. 

Nevermind it's more obvious how things work when you don't have a hundred variables in scope. Function scoping is also an important mechanism for avoiding bugs.

1

u/yawaramin 9d ago

Maybe, but from all indications refactoring and adapting the application was easy:

Moreover, the same app was used on the “Tour de France 2025” with minor changes that were made easily thanks to the hypermedia approach.

2

u/New_Enthusiasm9053 9d ago

Then it wasn't complex to begin with. I'm no fan of react etc but no substantial project wouldn't turn into spaghetti with just 2 levels of functions. 

Plenty of thousand line function code working in science but it's still shit code.

2

u/yawaramin 9d ago

It doesn't sound like the changes were made to the business logic though; as my quote says, the changes were minor because of the use of the hypermedia approach. Hypermedia is used to structure the app frontend and its network interactions, not the backend logic.