Locality of Behavior: A Principle for More Maintainable Code

2025-07-03

This article introduces the principle of Locality of Behavior (LoB), which emphasizes that the behavior of a code unit should be readily apparent within that unit itself. The author uses examples of AJAX requests in htmx and jQuery to illustrate how LoB improves code maintainability. While LoB may conflict with principles like DRY (Don't Repeat Yourself) and SoC (Separation of Concerns), the author argues that judiciously prioritizing LoB enhances code readability and maintainability, ultimately leading to higher software quality and sustainability.

Read more
Development design principles

htmx: The Next jQuery? Stability-First Web Dev Tool

2025-01-06

htmx, evolved from intercooler.js, aims to be a stable and reliable tool for web development, much like jQuery's long-lasting success. The article outlines htmx's future direction: prioritizing stability over frequent updates; limiting the addition of core features, mainly extending functionality through the extension API; maintaining a quarterly release schedule. htmx's goal isn't to be a total solution for web applications, but to focus on simplifying hypermedia controls and better integrate with other tools and techniques, ultimately hoping its core functionality will be integrated into the HTML standard.

Read more
Development hypermedia