Dev Tools · 2h ago
Hard Object References: A Discipline to Prevent Stale Aliases in JS
The article introduces Hard Object References, a coding discipline that keeps object and array references stable by using const and mutating in place rather than rebinding. This prevents stale alias bugs where old references point to outdated data. The approach applies to application state, local variables, and temporary objects.
Meridian48 take
While the principle is sound for mutable state, it conflicts with immutable patterns popular in React and Redux, so developers should weigh trade-offs.
Read the full reporting
Hard Object References: Stable Object References for Mutable Application State →
DEV Community
javascriptcoding-discipline