💭 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 [1] 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 `$("#d1")`. > Consider two different implementations of an AJAX request in HTML, the first in htmx: ``` heml Click Me > and the second in jQuery: ``` js $("#d1").on("click", function(){ $.ajax({ /* AJAX options... */ }); }); ``` ``` html Click Me ``` !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://htmx.org/essays/locality-of-behaviour/ [2]: /thoughts/ [3]: /tags/thoughts/