News for hackers. Stuff that matters.
Re:Why Vanilla JavaScript by inigyou on Monday July 13, 2026 @04:18AM (#48889452)
Your first thought might be to use React, but in prior eras we wrote a function updateFieldVisibility() and that worked fine. Straightforward code can be faster than using a state management framework to determine exactly which fields' visibility changed.
Re:Why Vanilla JavaScript by dsego on Monday July 13, 2026 @04:38AM (#48889632)
But it's harder to have component composition. Consider also lists and adding/removing items and so on, juggling all of it gets insanely complex and requires MVC or MVVM patterns like with backbone.js
Re:Why Vanilla JavaScript by inigyou on Monday July 13, 2026 @07:26AM (#48891029)
You just call updateFieldVisibility() every time the list selection changes and don't worry about the redundancy.
Re:Why Vanilla JavaScript by oneeyedpigeon on Monday July 13, 2026 @05:40AM (#48890106)
But now we're back at "Not everyone is building complex UIs like google sheets". I agree with the underlying sentiment of this thread: overengineering is way more common than underengineering.
Re:Why Vanilla JavaScript by dsego on Monday July 13, 2026 @06:17AM (#48890419)
Eventually each crud form evolves into something more complex, the bar is set higher today, we expect pagination, filtering, search, inline editing, grids, instant validation, auto-save, push notifications, state sync, ... that's not a complex UI nowadays, it's expected. Not sure what a non-complex UI looks like.
Re:Why Vanilla JavaScript by not-a-llm on Monday July 13, 2026 @04:51AM (#48889700)
it can be faster, but is it correct?

React was invented because jQuery style state management collapsed into unmanageable code past a certain size

Re:Why Vanilla JavaScript by dsego on Monday July 13, 2026 @06:24AM (#48890481)
And it wasn't composable, state was kept in the DOM. Even with higher level libs like backbone we didn't have a component-oriented way like now. Each component had to manually manage all of its child components.
Re:Why Vanilla JavaScript by inigyou on Monday July 13, 2026 @02:44PM (#48896972)
It composes to one level. Each <input> is a component. Is that good enough for your application? For many, it is.
Re:Why Vanilla JavaScript by dsego on Tuesday July 14, 2026 @06:27AM (#48904608)
Really sorry to have to say this, but I feel like I'm getting underpaid for the work that I do if people make a living clobbering together input elements and calling it web development.