3 ms·
The fundamental problem is not that the SPA pattern is bad, is that it takes a lot of skill and effort to make a proper SPA. Obviously, skill and time are scarc
by pier25 6y ago
The fundamental problem is not that the SPA pattern is bad, is that it takes a lot of skill and effort to make a proper SPA. Obviously, skill and time are scarce resources and the result is that most SPAs are crap.
OTOH all these component based frameworks have definitely brought us a much better way to produce interactive experiences compared to the jQuery days. This is not related to SPAs at all. You can use React/Vue/etc in a multipage application. The problem is that to hydrate (make interactive) the server rendered HTML you now need to duplicate your markup between your server language and front end framework. The solution is to use the same framework in the backend and the front and write the components just once.
- postpawl 6y agoThis discussion has happened a million times on HN and this is the most succinct explanation I’ve seen so far. Bravo
- 1ark 6y agoRecently I got to work with hybrids.js (webcomponents) which makes the hydrate part nice. Because it is normal markup with whatever data you have on your SSR-pages. It simplified quite a bit.
- pier25 6y agoVery interesting! Thanks for the recommendation.
- austincheney 6y agoNo, it doesn’t take that much skill. I think this is the source of the problem. The stupidity and hostile fear of originality I detect in this these comments is a very real reflection of my professional experience. This, dependence on frameworks and inability to imagine anything beyond the common SPA, really scares the shit out of me knowing I will be coming home from a military deployment soon and returning to the corporate world are scared to write code. Whenever non programmers ask me what programming is like I tell them it’s full of the most insecure people you can ever meet. People are afraid to do their jobs, need a framework for everything, and always talk about how hard it is (when it isn’t).
- sumedh 6y ago> No, it doesn’t take that much skill. That is a pretty bold statement to make.
- austincheney 6y agoNot at all. It would only be a bold statement if it weren't so immediately validated in practice. A developer can write code or they can't.
- sumedh 6y ago> A developer can write code or they can't. Uhh that is not how it works. I can write code but if you tell me go and write in assembly or C, I cant because I think its outside my circle of competence. Maybe you find SPA's easy others dont.
- austincheney 6y agoI have been writing software for 20 years. It's exactly how it works. You can, after a necessary onboarding period, accomplish the task you were hired to accomplish or you can't.
- azhu 6y agoAgreed. This is indeed how it works. Changes in company culture trends somewhat lend to the perception of newer programmers that they hold competency beyond what they do, which contributes to the overall problem of software being hard and an unstable industry. I used to not be able to code, and now I can. By that I mean I used to not grok the purely abstract domain of encoding meaningful computation and only the concrete domain of when I type a certain sequence of keys in ${languageX} and press some other stuff, stuff happens. Now that I better understand the abstract domain the concrete domain of programming languages translate, I am much better able to pick new tools up and understand whether or not they should be picked up.
- 6y ago
- fendy3002 6y ago> The fundamental problem is not that the SPA pattern is bad While it's not bad, SPA forced you to do view validation twice, one on backend and another on frontend. (Generally) Let's say that in HN not everyone can view upvote score of comment. With classic server rendering, you can put the check on view directly (though not recommended, it's sometimes useful to cut corners) and it's guaranteed that those users won't see the score. OTOH you can't do that with SPA, since you can easily sniff the content via API response.