π > htmx ~ Locality of Behaviour (LoB)
ββββββββββββββββββββββββββββββββββββββββ
!https://htmx.org/essays/locality-of-behaviour/
Date: October 28, 2023
> htmx ~ Locality of Behaviour (LoB) Carson Gross explores the Locality of Behaviour (LoB) principle, which emphasizes making the behavior of code units obvious on inspection to enhance maintainability. He discusses the tradeoffs betw... htmx.org
Interesting principle here. What a great example, If Iβm looking at the second jQuery example, I have to dig into dev tools or make some assumtions that this team uses jQuery, and selects by id, therefore I can grep for [38;2;167;192;128m$("#d1")[0m.
[38;2;122;132;120mβ [0mConsider two different implementations of an AJAX request in [4m[38;2;127;187;179mHTML[0m <[38;2;122;132;120m/html/[0m>, the first in [4m[38;2;127;187;179mhtmx[0m <[38;2;122;132;120m/htmx/[0m>:
[38;2;122;132;120m[heml][0m
> and the second in jQuery:
``` js
$("#d1").on("click", function(){
$.ajax({
/* AJAX options... */
});
});
[38;2;122;132;120m[code][0m
[38;2;71;82;88mNOTE[0m
[38;2;71;82;88mβ [0mThis post is a [4m[38;2;127;187;179mthought[0m <[38;2;122;132;120m/thoughts/[0m>. Itβs a short note that I make about someone elseβs content online [4m[38;2;127;187;179m#thoughts[0m <[38;2;122;132;120m/tags/thoughts/[0m>