5 ms·
Not to be too negative, but I'm seeing a lot of purely anecdotal comments on HN with lots of fuzzy gut feelings and very little to back up what seemingly amount
by robgibbons 7y ago
Not to be too negative, but I'm seeing a lot of purely anecdotal comments on HN with lots of fuzzy gut feelings and very little to back up what seemingly amounts to elitism against JavaScript.
It's very easy to write fast JavaScript, with React or pick-your-framework. I would argue that these frameworks go out of their way to help you do that. But carelessly throwing modules at your problem is not going to get you that.
There are many reasons why SPAs can be slow. Whether that is due to truly lazy developers, overly tight deadlines, or management that just doesn't care is often left out of these discussions.
Everyone likes to complain about SPAs, as if terrible load times are a fundamental trait of frontend frameworks. That is not at all the case.
- GoblinSlayer 7y agoIt's elitism against low quality. Webdev inflated dramatically and cuts the costs to absolute minimum, so quality drops severely. It's not only javascript, everything in webdev is low quality, it's not a fundamental trait, it's a real life trait. Turing complete part is just more sensitive to low quality. Flash is what web 2.0 really wants, but has to emulate it with enormous hacks, while having similar security implications, it repeats history.
- smt88 7y agoBrowsers already have a full-featured Flash alternative: canvas
- scarmig 7y agoA SPA is predictive of a web application that has substantial performance, UX, and accessibility issues. A high schooler can build a page with some simple HTML and some jQuery sprinkled in that makes for a substantially more pleasant experience than teams of professional developers regularly manage to do with SPAs. I'm sure there are SPAs that are pleasant and add value above the alternative, but they are clearly very hard to build correctly, as evidenced by how many multi-million dollar SPAs are pieces of shit. It's kind of besides the point whether that's an organizational or engineering failing, because the very fact that SPAs lend themselves to those kinds of failings is an indictment of them.
- baddox 7y agoThe fact that very large SPAs are harder to build and maintain and thus easier to mess up isn’t a very compelling argument for the people who have the ambition to build great SPAs. More ambitious projects are easier to mess up, of course.
- Vinnl 7y agoBefore I was a professional developer, I made a really small application using just HTML, CSS and some jQuery: just a site that listed about ten recipes. When you selected the next recipe, it would change the page's background colour, doing a full repaint in the process. It was terribly slow.
- otabdeveloper4 7y ago> Everyone likes to complain about SPAs, as if terrible load times are a fundamental trait of frontend frameworks. That is not at all the case. I disagree. SPA frameworks attempt to re-implement browser UI and DOM within Javascript. Of course the result is buggy and slow. The browser already has a UI and DOM framework. Use it. (Yes, I know it's ugly. Such is life.)
- nickserv 7y agoDepends on the target audience. Many customers will be sold on how pretty an app is, sometimes to the point of overlooking missing features. Having a good looking app becomes a competitive advantage, and therefore important to spend time on. Such is life.
- otabdeveloper4 7y agoYour point is orthogonal, even if true. My point is that SPA frameworks are necessarily buggy and inefficient - after all, their whole point is to reimplement in a bespoke fashion the stuff that the browser already implemented. Buggy and inefficient stuff sometimes makes sense to a business, this is true.
- jiofih 7y agoThat’s a common misunderstanding and absolutely not true. They are abstractions and not reimplementation, and in practice can help achieve way better performance than what would naively come out. React is not a particularly good example of that. They also solve problems like state synchronization and mutations that the browser has zero facilities for. As mentioned in another comment above, in any medium sized project you’ll have implemented more than half a framework abstracting the DOM already.
- SirHound 7y agoTrying to remember the last bug I encountered in React. I’ll be a while.
- pjmlp 7y ago
- deleted 7y ago[deleted]
- nymanjon 7y agoAs a user of different websites, I have to say. I get extremely annoyed a SPA websites that should be server rendered sites. Over a 3G connection they are extremely slow and annoying. Especially when it should just be a simple page. And I know that it isn't the SPA itself that is the problem, since gmail loads its website extremely fast. I think the issue is poor practices in caching etc. But really, they don't need to worry about all those good practices if they would just render on the back end to begin with. Just give me simple pages with little unnecessary content so I can get on the page, get what I need and be off without having to wait 10 seconds between each page load (and yes, that is with the SPA).