3 ms·
I think this is missing the forest for the trees. The key innovation behind most modern frameworks is DOM abstraction and reactive data flow. The main reason JS
by jchw 7y ago
I think this is missing the forest for the trees. The key innovation behind most modern frameworks is DOM abstraction and reactive data flow. The main reason JS apps were, at one point, ugly spaghetti directly manipulating DOM structures using jQuery is because JS was dog-slow at a point and was not really capable of doing the cool object oriented stuff you could do on desktop apps. jQuery answered to the problems of the time: it was relatively fast, provided a terse interface (vs DOM,) and probably most importantly, it smoothed over browser bugs and inconsistencies. Angular.js finally popularized components, in the post IE6 era when JavaScript execution was a lot less slow and unreliable, then React popularized reactive data flow and virtual DOM.
I think most good ideas in software engineering have already been discovered, and primary innovation has long been applying existing ideas more effectively. Hard to argue Angular.js or React does anything that has genuinely never been done before, and same to ColdFusion.
- Udik 7y ago> JS was dog-slow at a point and was not really capable of doing the cool object oriented stuff you could do on desktop apps. Absolutely wrong, Javascript was always fast enough to make web applications that had the responsiveness of desktop apps. The problem is that nobody was writing desktop apps in the browser; they were writing server-generated web pages that offered the users some extra interactivity via js. So they had to look for elements in a static template, and hook into them or perform transformations on the fly, instead of generating everything programmatically as it's done now.
- jchw 7y agoYou dismissed my claim without any numbers, so too shall I. Of course it was slow, extremely so. Pointedly, Objects were Especially slow, and even a performance cliff in V8 in many circumstances. Take a look at a React flamegraph, it’s incredible how deep and wide the callstacks are, for things that can easily run 60 times a second. You couldn’t do that years ago. IE6 and 7 were so slow in both JavaScript execution and DOM that it’s silly anyone would ever claim JS execution was “fast enough.” The art of fast JavaScript was once arcane, but its clear we’re so far into fast JS execution that nobody even remembers how awful it was. Especially when you had to support IE. Oh, and let’s not forget the incredible increases in CPU speed. Even a later Core 2 Duo machine I have is awful for browsing the web, basically unusable without uBlock Origin.
- Udik 7y agoSorry, I dismissed your claims because I was developing javascript single page applications in 2005 on IE6 (and on IE5 at the beginning, I think). That was before XMLHttpRequest, I was retrieving data from an invisible iframe populated with arrays. I was able to develop crud applications and dashboards with hundreds of objects with (almost) desktop-like responsiveness. Of course there was no jQuery, elements were created programmatically and I kept a pointer to each of them, as it's normal in desktop apps. Never thought of this as arcane, it was actually very natural.
- jchw 7y agoI don’t know why you assume I hadn’t been doing web development in 2005, but of course. I attempted SPAs and games in JS for a long time, and we have very different ideas about what performance means! I mean sure. Even pre-XHR you could write apps that were effectively SPAs, but manually manipulating HTML elements in your business logic isn’t exactly what I’d consider “modern.” Desktop apps at the time, even ones written on Win32, tended to put a couple layers of abstraction around the underlying resources, to say nothing of Qt and its entire programming model worth of abstractions. YUI, mentioned above, was already a significant step up from that. But those toys were nothing compared to what you can do today. Today you can literally compile the entire Qt libraries and a whole Qt app to JS and run it on Canvas and it’s usable on a fucking phone. Part of that is w3c typed arrays (and WASM, for extra perf,) but most of it is just years of raw optimization and CPU speed improvement. In 2009, I was still struggling to draw 60 frames per second (important to note: consistently. It was actually hard, at higher resolutions.) on canvas 2d. Just a few years later Unreal and Mozilla demoed Unreal Engine running at 60 fps in pure JS and WebGL. No reason to diminish what I’m sure you did accomplish in 2005 - it was probably amazing for 2005 - but I absolutely disagree that we didn’t experience life-changing performance improvements. The performance improvements we got enabled huge React and Angular apps to be possible. If you don’t believe me... again, try browsing the modern web on old machines. I've just recently set up a machine with an 800Mhz PowerPC from ~2004. Even with fairly modern Firefox, and adblocking, modern sites are basically unusable. Addendum: today’s bundle sizes also would not have worked too great on older internet. Another performance characteristic that is largely taken for granted today: parsing and network speed!
- kls 7y agoI would argue that YUI and Dojo where the ones that popularized components and angular 1.0 directives where a step backwards in truly encapsulating components as you could bleed scope all over the place. I agree with you on JS speed.
- jchw 7y agoThis is fair. I didn’t use YUI too much but in retrospect it was pretty modern for it’s time. Still, I don’t think YUI necessarily had the mindshare the same way Angular or jQuery once did...