You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: www/content/essays/paris-2024-olympics-htmx-network-automation.md
+15-28Lines changed: 15 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ project and a Bootstrap CSS customized internally by Orange.
81
81
We agreed on an 8-week timeline to cover the need, which involved 3 connectivity services: Direct Internet Access,
82
82
Private VLAN, and Shared Internet Access.
83
83
84
-
###Web Dev with HTMX
84
+
## Web Dev with HTMX
85
85
86
86
HTMX is somewhat a return to the roots of web development, and regardless of the web framework: Django, ROR, Symphony...
87
87
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
99
99
<figcaption> Progress bar from RCP Portal </figcaption>
100
100
</figure>
101
101
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/)!
103
105
104
106
Why this choice? Because it's coded in 10 seconds, because the app won't have thousands of users on this internal tool,
105
107
no scaling concerns: you can do good old data polling without any problem.
106
108
107
109
And the end user? If I use old-school polling, they don't care: what they want is the information. No SSE or WebSocket
108
110
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.
109
111
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
111
113
progress bar: if you want to know how it works, just look at the page source. No need to go into documentation or the
112
114
codebase, just a right-click and "View Page Source":
113
115
@@ -132,21 +134,23 @@ you need to know is right in front of you.
132
134
And that's exactly what HTMX is about: every component, every interaction remains visible, understandable, and
133
135
self-documented directly in the HTML. This is important for what comes next.
134
136
135
-
###HTMX is "AI friendly"™
137
+
## HTMX is "AI friendly"™
136
138
137
139
In the early stages of app development, I focused on the most complex network service: DIA (Direct Internet Access). DIA
138
140
for the Olympic Games meant many business parameters with many rules to apply.
139
141
140
142
The DIA creation form calls an endpoint that triggers a very long function, close to 600 lines of code.
141
143
142
144
Why such a long function?
145
+
143
146
Because it's more readable and efficient to concentrate the data flow in one place, rather than dispersing it across a
144
147
multitude of layers and patterns.
145
148
146
149
An application is a wrapper around data: it orchestrates the data flow (data must flow!) and CRUD operations. But what
147
150
control do you retain when this flow is obfuscated in complex patterns or dispersed across 2 codebases?
148
151
149
152
The data flow must remain readable for the developer.
153
+
150
154
HTMX, by allowing you to manage the GUI directly server-side, makes this flow even clearer. The same endpoint can return
151
155
HTML fragments to signal that certain form data is invalid, or conversely indicate that a service deployment has
152
156
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
156
160
readable data flow.
157
161
158
162
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.
168
164
169
165
For the Private VLAN (PVLAN) network service, the "shape" of the main function is roughly the same as for DIA: input
170
166
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
181
177
both the DIA and PVLAN functions. With the magic word *"extrapolation"* in the prompt, the generated code was 95%
182
178
correct.
183
179
184
-
<br/>
185
-
---
186
-
<br/>
187
-
188
-
In summary:
180
+
## Summary of My Experience
189
181
190
182
-**DIA**: 0% AI, 100% handwritten code (business logic + GUI + overhaul of the switch configuration task management
191
183
system) → **4 weeks**
@@ -198,20 +190,15 @@ scope.
198
190
Moreover, the same app was used on the "Tour de France 2025" with minor changes that were made easily thanks to the
199
191
hypermedia approach.
200
192
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.
210
196
211
197
For an LLM, this is ideal: it doesn't need to construct context through a complex architecture. It just needs to follow
212
198
the flow and extrapolate it to a new use case. In other words, what's simpler for the developer is also simpler for the
213
199
AI. This is the sense in which HTMX is truly *"AI friendly"™*.
214
200
215
201
Ultimately, HTMX mainly allowed me to save time and keep my code clear.
216
202
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