back

by masswerk·10y ago·view on hn ↗
I'm coding JS now professionally for 20 years (so, quite from the beginning) and I love the language.

That said, I think, current frameworks are, with all due respect, rather over-engineered. – A tool chain consisting of at least 8 items, a multiline CLI command to compile a hello world that comes at a mere 19.500 lines of code? (Some may remember when early Java versions were made fun of for a 2MB hello world object code.) I would love to see JS back in its core domain which is / has been (choose your own) real-time interaction. I dare say, we haven't seen much of this lately, at least not in creative and novel ways.

3 comments
JS is evolving so developers want to take advantage of new features while still supporting old browsers, which makes complicated pipelines mandatory. Should developers stick with ES5 instead ? I personally like using classes instead of prototypes as it makes my code more readable. fortunately I can develop with a browser that supports a lot of ES6 features so the pipeline is only mandatory for staging,testing on old browsers and production.

Next working with Raw DOM nodes when you have to develop a complex single page app isn't really efficient. You need a way to write reusable components, these components need to be composite, and need to take care of their own life cycle ( registering, unregistering event listeners,...) . So basically it means creating a component system on top of the DOM. The DOM wasn't created to build complex applications, therefore it needs to be abstracted in some ways.

The alternative is to do everything on the server, and fetch HTML fragments to update the page through ajax when a specific event is dispatched. Sometimes that solution scales, sometimes it doesn't.

ES6 by the way makes working with the DOM a bit easier, and ES6 modules will help developers moving away from monolithic frameworks.

But maybe it comes down to the fact that many developers simply like over engineered solutions and sprinkle some complexity to often boring problems? Not saying that it's always the case but surely many of us can recollect related stories :)
For me, its more about the frameworks shoving between you and the presentation layer. It's not realtime and interactive anymore (rather about packed and delayed update/repaint cycles). Consider what could be done alone using the canvas 2d-context with the current API. There isn't a visual thing that couldn't be done with this. Some may remember the creative wealth of CD-ROMs in the 1990s – we may have all of this, but better. Instead, it seems more about a glorified mark down presentation layer. We really could do better.

P.S.: Maybe, this is just an old man's rant about the old days like when PostScript was all written by hand and typo came in stars. But I'm really underwhelmed by the state of creativity on the web.

There definitely are lean frameworks around. Mithril.js is a good example, being small and standalone itself, and having inspired several spin-off projects that share the philosophy of having simplicity as a goal.