4 ms·
Separating JS and markup was important when we were imperatively mutating the DOM by hand. Writing "inline" JS is necessarily global, and therefore makes writin
by namuol 11y ago
Separating JS and markup was important when we were imperatively mutating the DOM by hand. Writing "inline" JS is necessarily global, and therefore makes writing modular code a lot harder.
In other words, separating JS from the markup allowed us to write more modular (and therefore less error-prone) code, but was sometimes harder to think about.
Components capture the markup with the JS behavior that corresponds with it in a modular fashion; it's the best of both worlds. It really is a step forward.