Skip to content

Commit 709512c

Browse files
committed
formatting & a bit of editorial work
1 parent 5a374d5 commit 709512c

1 file changed

Lines changed: 15 additions & 28 deletions

File tree

www/content/essays/paris-2024-olympics-htmx-network-automation.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ project and a Bootstrap CSS customized internally by Orange.
8181
We agreed on an 8-week timeline to cover the need, which involved 3 connectivity services: Direct Internet Access,
8282
Private VLAN, and Shared Internet Access.
8383

84-
### Web Dev with HTMX
84+
## Web Dev with HTMX
8585

8686
HTMX is somewhat a return to the roots of web development, and regardless of the web framework: Django, ROR, Symphony...
8787
You rediscover everything that makes a web framework useful rather than turning it into a mere JSON provider. Sending
@@ -99,15 +99,17 @@ If you ask me what's most striking, it's certainly returning to very simple thin
9999
<figcaption> Progress bar from RCP Portal </figcaption>
100100
</figure>
101101

102-
How does this progress bar work? Exactly like [the example in the docs](https://htmx.org/examples/progress-bar/)!
102+
How does this progress bar work?
103+
104+
Exactly like [the example in the docs](https://htmx.org/examples/progress-bar/)!
103105

104106
Why this choice? Because it's coded in 10 seconds, because the app won't have thousands of users on this internal tool,
105107
no scaling concerns: you can do good old data polling without any problem.
106108

107109
And the end user? If I use old-school polling, they don't care: what they want is the information. No SSE or WebSocket
108110
for this use case, I don't need it. And if the need ever arises, the WebSocket (or SSE) plugin is easy to set up.
109111

110-
One of the big advantages of the philosophy surrounding HTMX is the notion of Locality of Behaviour. Let's take this
112+
One of the big advantages of the philosophy surrounding HTMX is the notion of [Locality of Behaviour](@/essays/locality-of-behaviour.md). Let's take this
111113
progress bar: if you want to know how it works, just look at the page source. No need to go into documentation or the
112114
codebase, just a right-click and "View Page Source":
113115

@@ -132,21 +134,23 @@ you need to know is right in front of you.
132134
And that's exactly what HTMX is about: every component, every interaction remains visible, understandable, and
133135
self-documented directly in the HTML. This is important for what comes next.
134136

135-
### HTMX is "AI friendly"™
137+
## HTMX is "AI friendly"™
136138

137139
In the early stages of app development, I focused on the most complex network service: DIA (Direct Internet Access). DIA
138140
for the Olympic Games meant many business parameters with many rules to apply.
139141

140142
The DIA creation form calls an endpoint that triggers a very long function, close to 600 lines of code.
141143

142144
Why such a long function?
145+
143146
Because it's more readable and efficient to concentrate the data flow in one place, rather than dispersing it across a
144147
multitude of layers and patterns.
145148

146149
An application is a wrapper around data: it orchestrates the data flow (data must flow!) and CRUD operations. But what
147150
control do you retain when this flow is obfuscated in complex patterns or dispersed across 2 codebases?
148151

149152
The data flow must remain readable for the developer.
153+
150154
HTMX, by allowing you to manage the GUI directly server-side, makes this flow even clearer. The same endpoint can return
151155
HTML fragments to signal that certain form data is invalid, or conversely indicate that a service deployment has
152156
started. You can thus act on any part of the GUI within the same function, while transforming the data to pass it to the
@@ -156,15 +160,7 @@ In a traditional frontend/backend approach, this would be more complex: two appl
156160
readable data flow.
157161

158162
This drastic code simplification enabled by HTMX, combined with a procedural approach, produces compact and transparent
159-
logic, easy to navigate for a developer... or for an LLM.
160-
161-
<br/>
162-
163-
---
164-
165-
<br/>
166-
167-
This is where it gets interesting.
163+
logic, easy to navigate for a developer... or for an LLM, as I discovered.
168164

169165
For the Private VLAN (PVLAN) network service, the "shape" of the main function is roughly the same as for DIA: input
170166
parameters, validation, then interactions with the GUI via HTML fragments, and, if everything is correct, switch
@@ -181,11 +177,7 @@ For the third network service, Shared Internet Access (SIA), even simpler than t
181177
both the DIA and PVLAN functions. With the magic word *"extrapolation"* in the prompt, the generated code was 95%
182178
correct.
183179

184-
<br/>
185-
---
186-
<br/>
187-
188-
In summary:
180+
## Summary of My Experience
189181

190182
- **DIA**: 0% AI, 100% handwritten code (business logic + GUI + overhaul of the switch configuration task management
191183
system) → **4 weeks**
@@ -198,20 +190,15 @@ scope.
198190
Moreover, the same app was used on the "Tour de France 2025" with minor changes that were made easily thanks to the
199191
hypermedia approach.
200192

201-
<br/>
202-
---
203-
<br/>
204-
205-
Why is this result possible?
206-
207-
Because the combination of *HTMX + procedural approach* produces naturally readable code, without unnecessary
208-
abstraction layers. The data flow is clear, concentrated in a single function, and the GUI/server logic is directly
209-
accessible.
193+
This result is possible because of the combination of *HTMX + the procedural approach*, which produces naturally
194+
readable code, without unnecessary abstraction layers. The data flow is clear, concentrated in a single function, and
195+
the GUI/server logic is directly accessible.
210196

211197
For an LLM, this is ideal: it doesn't need to construct context through a complex architecture. It just needs to follow
212198
the flow and extrapolate it to a new use case. In other words, what's simpler for the developer is also simpler for the
213199
AI. This is the sense in which HTMX is truly *"AI friendly"™*.
214200

215201
Ultimately, HTMX mainly allowed me to save time and keep my code clear.
216202
No unnecessary layers, no superfluous complexity: just concrete stuff that works, fast.
217-
And that's what makes the difference on critical projects.
203+
204+
And that has made a big difference on these critical projects.

0 commit comments

Comments
 (0)