18 ms·
Angular without SSR is faster than Next.js with SSR
- pictur 4y agowhat are the advantages of using angular right now? in terms of documentation, it doesn't look like an atomic reactor compared to the past. more like simplified
- InsaneOstrich 4y agoIt's very opinionated compared to the alternatives and it has a "batteries included" kind of approach. There's a "right" way to do things and you don't need to pull in a lot of third party libraries for basic functionality. The native typescript support is really nice too.
- jeremycarter 4y agoI've worked on react apps where some features use different routers, state stores and component syntax. Angular gives you 2 ways to solve problems and keeps things consistent and on the rails.
- thm76 4y agoHaving stuff included does have advantages, but, in my opinion, some of those included things in Angular are really badly designed (I'm looking at you, Forms) I never use Angular for personal projects, and I have been using TypeScript exclusively for years. I.e. other libraries work really well with TypeScript as well (sometimes actually better than Angular, in my experience)
- jeremycarter 4y agoAngular has great support. It is the front end to some absolutely huge apps like Google AdWords, Google Cloud Platform etc. Angular shines when you have 10+ devs working on the project. It's not slow, flexible and the boilerplate module code will be removed in the next version. Basically you just have to give it a go, so many people trash technology without giving it a unbiased go.
- steve_adams_86 4y agoHaving used Angular 1 then migrating to 2, and then trying it again very recently I wonder if a lot of people were burned by early Angular and unwilling to try it again. It’s leaps and bounds ahead of what it was in terms of end user and developer experience. The tooling is dramatically improved. If you asked me 6 months ago what my position on Angular was, I probably would have said something like “I haven’t used it recently, but older version were pretty awful. Bad DX, incredibly slow builds, huge bundle size, etc”. Today I think it’s pretty compelling for the right projects. Like anything that doesn’t just fade away, there’s a reason people still use it. There are some talented and intelligent people driving it forward. I’m not eager to use it, but I was really glad to see how much it has improved.
- wdb 4y agoYes, Angular 1 wasn't great and I haven't looked back
- zdragnar 4y agoThe code quality of angular 4/5/6 and the add-on packages was so bad, I wouldn't want to lock myself into that ecosystem ever again. I don't remember exact numbers, but I'm pretty sure that about half the bugs that project had were due to angular, poorly designed Rxjs interactions, or angular flex-layout.
- steve_adams_86 4y agoI love RxJS and the testing story is not bad, but it does manage to find ways to be buggy when I encounter it. It seems like both a strength and a weakness of the Angular ecosystem. Maybe the testing story needs to improve? I can’t recall how exhaustive marbles are, and maybe fuzzing might help catch gotchas? Honestly I thought RxJS would benefit a ton from a visual builder. They have this decision tree tool for helping figure out which operators you need to use, but you could go further and actually build out entire observables in a similar way, plotting out the system and behaviours visually along the way. When you have such excellent boundaries and well defined behaviours, but observables can become complex so easily, it seems like a great opportunity to visualize and constrain things with tools which generate the code you need. I know some might find that gets in the way of programming, but I have a feeling it would help those who struggle with RxJS produce far more stable observables. This is actually why I began using XState for a lot of things. Although I can write out all of the logic myself easily enough, their tooling seems like it’s on a very promising path to making complex state management far more approachable to people with less experience. Having well defined state, transitions, and a great testing story is huge in avoiding the kind of buggy mess I’ve seen and you seem to be describing around Angular.
- Alex3917 4y ago> What are the advantages of using angular right now? A low total cost of ownership compared to other frameworks because: - The code for every Angular project is structured the same way - The code for components (and directives, services, etc.) is generally very readable - Everything is easy(ish) to test - 280k Stack Overflow questions, vs 95k for Vue and 19k for Next And ease of hiring due to 170k Angular developers in the US (per Sales Navigator), as opposed to 50k for Vue.js and 48k for Next.js And in general Angular seems much easier to learn. If you spend 20 hours watching the Udemy course then you pretty much know it, whereas I regularly see job ads looking for folks with 6+ years of React experience. Now obviously you always hear about job ads looking for folks with 10 years of experience with some technology that's been around for two years, and yet I rarely come across Angular job ads that implicitly assume it takes multiple years to learn how to use the framework correctly.
- acdha 4y ago> - 280k Stack Overflow questions, vs 95k for Vue and 19k for Next > And ease of hiring due to 170k Angular developers in the US (per Sales Navigator), as opposed to 50k for Vue.js and 48k for Next.js Listing large numbers without commentary is a bit of a red flag unless you can point to how you analyzed the raw data — e.g. does more questions mean more happy users or more problems which people can't figure out on their own? Does that developer figure exclude the people who said “I used Angular 1, hated it, and switched to React”? That last is related to the conspicuous absence of React, which has higher numbers in both categories.
- bryans 4y ago> The code for every Angular project is structured the same way - The code for components (and directives, services, etc.) is generally very readable - Everything is easy(ish) to test. [...] And in general Angular seems much easier to learn. If you spend 20 hours watching the Udemy course then you pretty much know it You just described every frontend framework. None of these are unique to Angular. Any developer with an understanding of JS can learn and use any framework in the exact same way. > 280k Stack Overflow questions, vs 95k for Vue and 19k for Next. And ease of hiring due to 170k Angular developers in the US (per Sales Navigator), as opposed to 50k for Vue.js and 48k for Next.js These are false comparisons, and you're conveniently leaving out the largest competitor. A higher SO question count isn't necessarily a positive metric, and may even imply substantial confusion about the framework. More importantly, all of the surveys[1] show that both developer and hiring interest for Angular is waning. > whereas I regularly see job ads looking for folks with 6+ years of React experience. Now obviously you always hear about job ads looking for folks with 10 years of experience with some technology that's been around for two years, and yet I rarely come across You're using a popular meme about some notoriously bizarre job listings written by HR managers (or interns) to suggest that developers have a harder time learning frameworks other than Angular. There is no correlation whatsoever between these two things. When "you always hear" and "yet rarely come across," you are experiencing the effects of confirmation bias. > Angular job ads that implicitly assume it takes multiple years to learn how to use the framework correctly. If a job lists multiple years of experience as a requirement, why would that automagically mean the employer is "implicitly assuming" multiple years of training is required to accomplish a bare minimum? In reality, it means they're looking for someone who didn't spend last weekend watching a 20 hour Udemy course to obtain a cursory understanding. They're requiring real-world experience in a similar work/project environment, and they are paying handsomely for that experience. If it were junior development jobs with these requirements, you'd maybe have an argument, but 100% of senior positions have minimum work history requirements, because that is the definition of senior. [1] https://gist.github.com/tkrotoff/b1caa4c3a185629299ec234d2314e190 https://gist.github.com/tkrotoff/b1caa4c3a185629299ec234d231...
- trhoad 4y agoI worked with React almost exclusively for ~5 years. I got so fed up with everyone reinventing the wheel on every project, coming to Angular (late) was a massive breath of fresh air. I now spend more time building valuable features rather than discussing changing state management libraries and people banging on about hooks all day long. YMMV, and I'm certainly in the minority, but I'd probably choose Angular over React for any new projects now, personal or professional. The only thing I really miss is that JSX is much more ergonomic and the devtools for React are a bit better.
- coding123 4y agoI would have to agree with this sentiment. I think one of the best things about hooks in general is that it put to rest all the third party state management libraries. At least now you can just agree with most people and move forward with hook state. That being said, I think the ergonomics in React development (JSX) are SOO much better than Angular that I still prefer it.
- trhoad 4y agoJSX is the best thing about React, and the Angular templating is worst thing about Angular, so I can certainly empathise with that being the tipping point.
- moystard 4y agoMy experience is very similar to yours, and I concur with your conclusion. After 5 years of React, I joined a new organisation as engineering lead, and the team had embraced Angular before I joined. Coming from the React/Next.js world, I was really puzzled with that decision as I still had in mind the trauma of the Angular.js -> Angular migration and the breath of fresh air that React had represented at the time. As most engineers out there, I had an urge to stick to what I knew would work, but I resisted that urge and gave Angular a chance. I do not regret it; Angular and the structure the framework provides is a game changer for a large project; the conventions make the code and the architecture predictable/testable/scalable. Our time is spent on delivering value for our users. This is, in my opinion, the best quality a technology can have when working on a fairly large project.
- aluminum96 4y agoIn my opinion, the biggest advantage of Angular is how batteries-included it is. Everything just works out of the box, and project configuration is very standardized. The framework owns everything from common UI components (Angular Material) to your build process (Angular CLI) to non-core packages (router, forms) to state management (RxJS).
- aluminum96 4y agoI'm going to reply twice, because I'm a true believer (TM). Another set of advantages comes from how declarative Angular is. With React and JSX, everything is super imperative (setState, loops to generate dom, etc). In Angular, RxJS gives you a really powerful reactive model for your state, directives give you a much more declarative way of describing application behavior, and the limited template microsyntax encourages you to put the complexity in your typescript, not in templates.
- EugeneOZ 4y agoAdd OnPush + NgRx
- LocalPCGuy 4y agoOthers have mentioned most of the big points, so gonna be a bit contrary and ay I like being able to actually write HTML/CSS and not JSX and whatever the current flavor of the month is for CSS in React is these days. I like marking up my HTML rather than writing JSX personally. I'm sure I'll have to embrace JSX as some point, but don't see it as the huge win that others seem to consider it when I have played with it.
- hinkley 4y ago> write HTML/CSS and not JSX I don't know how much people have changed, but generally people don't change very fast so this is probably still relevant: If the HTML doesn't look like HTML and the CSS doesn't look like CSS, you end up with a bunch of problems that can only be solved by the people who aren't invested in it. Designers and UX specialists end up being hobbled if they are expected to make heads or tails of the Turing Complete parts of the code. And once they feel hobbled they tend to shut down even more, and it's just pain getting any improvements in. Mostly HTML with a little code is already at the very edge of their comfort levels. JSX and things like JSX have been abandoned more times than I can count, and there's always some necromancer who brings it back.
- LocalPCGuy 4y agoIt also shuts down an entry into the world of web development (and development in general). Sadly, I know some see this as a feature, not a bug, but I know a number of people who are great developers who started out doing HTML/CSS and learned programming (JavaScript and much much more) along the way. Some are in very high positions now at companies most of us in this industry are aware of. I'm not saying they wouldn't have found another way into the industry, but it would have been significantly more up front learning before they could start working professionally. I know that entry-level positions of that nature (mostly just HTML/CSS) are getting more and more rare, but to me that is very sad and limits the potential for some really great people to be part of our industry.
- hinkley 4y ago
- nicoburns 4y agoArticle can be summarised by this quote (which I very much agree with): > It's very clear from this data that choice of framework is not the primary driver of site performance; just manually looking at the source code for some of these sites, it's clear that it's things like unnecessary dependencies, outdated dependencies, sites running development mode in production, etc. Personally, I use React, not because it's faster than Angular, but because it's much more pleasant to work with.
- andai 4y agoFor many years I believed that better gear would make me a better artist. I learned the hard way that this just ain't so. I think the same idea applies in this context.
- tshaddox 4y agoSounds like very different ideas. I'm pretty sure having a work environment and tools that are more pleasant to work with will indeed make you a better artist.
- jacksnipe 4y agoIf you’re having trouble learning to paint, but you’re trying to learn with a fork, then you should start by replacing the fork. If you’re having trouble painting because your paintbrush isn’t made of squirrel hair, then you just need to learn to fucking paint.
- FinalBriefing 4y agoI've found that SSR is generally quite slow. If you're using it, you'd want a CDN or some other caching layer in front of your server so you don't need to render each page server-side.
- TylerE 4y agoWhat about stuff like Phoenix LiveView, which can push dozens of updates per second per client to hundreds of clients simultaneously?
- doliveira 4y agoI actually find it sad that this passes as "impressive" these days
- TylerE 4y agoI mean, this is on a single core, not a cluster.
- switchbak 4y agoAccording to Wikipedia: "The term C10k was coined in 1999", and we've been discussing the C10M problems for years now. Clearly this is doing a lot more work than serving static content, but .... dozens per second? Even per-core, that's a shockingly low number.
- TylerE 4y agoDid you miss the hundreds of clients bit? So we're talking several thousand responses per second per core. I think that's fairly impressive, and VERY different from an FTP server connection that isn't really doing much most of the time.
- doliveira 4y agoEven then, the heavy lifting of pushing the dozens of updates is mostly in the kernel, isn't it? Don't get me wrong, it's pretty good and just the fact that you're pushing these stats reflects quite well on my (external) impression of Phoenix: most don't even bother to try and just resort to "hardware is cheap". It's just that this should be the default. Reminds me of this tweet from @SwiftOnSecurity: > Once you understand your computer has 16 cores running at 3GHz and yet doesn't boot up in .2 nanoseconds you understand everything they have taken from you.
- onion2k 4y agoI have a theory that pretty much every developer saying "X is best for Y" is simply believing what a developer relations engineer or evangelist has said to them at a conference (or they read on a blog post, or heard 5th hand from a dev they know). What they fail to realise is that people who work in dev rel jobs are paid to promote a product. Next.js is wildly popular because the dev rel team are excellent devs who produce fantastic content, but they're paid to promote Vercel and Next, and they do it well, but they don't mention where it isn't a good fit. Consequently every frontend dev claims Next is the answer to everything, and then builds a site that doesn't work very well because it doesn't fit Next's model. I'm singling out Next but it's not limited to that framework. I like Next. I use it. I spent weeks working out if it could do what I need before I started. The problem isn't Next, it's applying Next where it doesn't fit. This is true for everything that has paid promoters. You have to do your homework. You can't blindly trust what the internet says. When the dev industry stops conflating the opinion of someone paid to promote a product with stop cold facts that apply to everything then things will improve.
- fullstackchris 4y agoI'm of the exact same opinion, but I've mostly given up on repeating similar notions. I think it's unlikely to change: I read something once that there are about 20 devs on all of twitter that generate 90% of all the tech chatter and hype. Some days it feels the everybody software industry puts their trust in a handful of famous ex-<insert FANGG> here or famous youtubers / bloggers and takes what they say as undeniable truth (Though this is true for nearly everything nowadays, everything trite, washed down, and summarized with no heart or nuance) There's a great saying in German: "Die kochen auch nur mit Wasser" - They also cook only with water. Sure, some of these youtubers and bloggers are super smart and helpful, and there are brilliant people who have worked at Silicon Valley companies. But there are smart, helpful, and brilliant people at nearly every company around the world. It just so happens that not all of them blog, have a twitter, or have youtube channels. Sorry for the oldmanish grumbling but the more I learn about this industry is that everything is about picking the right tool for the job, documenting the arcane decisions made, and managing all of those decisions. When you really start getting into the weeds, the (IMHO) junior level ideals of 'perfectly clean code' and '100% code coverage' rapidly go out the window. We're _maintainers_ of complex systems, not wizards with panaceas. 100% of the time it is picking the tool for the job, and know what you are doing with that tool. Experimenting? Great. Learning something new? Great. Just don't lumber into your organization one day saying "we should do X or Y because its the hype, or Z said so". Many painful stories can be shared on this type of mentality.
- ec109685 4y agoThis is such a misleading headline. It compares the speed of a basket of sites that happen to use Angular in some capacity with a separate list of sites that happen to use Next.js and makes a broad sweeping conclusion about framework speed? I wonder how reliable this is for SSR as well (and sites that opt into SSR might actually have more complicated sites, so skewing the numbers): https://gist.github.com/Alex3917/fec45e5c2114c2c13b41b30e19887542#file-scrape_spa_performance_data-py-L84 https://gist.github.com/Alex3917/fec45e5c2114c2c13b41b30e198...
- dawnerd 4y agoYou can't even assume a nextjs page is SSR without being on the dev team.
- teg4n_ 4y agoYou just look at the response from the server… if the site html is fully fleshed out it’s SSRed
- dawnerd 4y agoTrue but you don't know if it's been exported as static, generated as static on build, progressively generated (generated once someone hits the page then cached) or generated on every page load.
- deleted 4y ago[deleted]
- jjice 4y agoGenuine question: what if you disable JavaScript and then load the page? Would you just get the SSR portion of the page and if it wasn't SSR at all then you'd get a blank page?
- dawnerd 4y agoHard to say since it depends(tm) but for the most part it should look like any other html site, react then just hydrates. IMO it's the best of both worlds. On the sites I've been working pages that have been server rendered work mostly perfectly with javascript disabled.
- friedman23 4y agoAngular could be the fastest framework in existence and that would still not be a good reason to use it.
- bgun 4y agoThis comment has the same energy as people who still use a dollar sign when spelling "Microsoft".
- antifa 4y agoExcept we all know Microsoft has been bad for decades and we all know Microsoft never actually got better. I have no idea why I would dislike angular beyond some mild personal preference.
- tcfhgj 4y agoWhy is speed not a good reason to use a framework?
- thm76 4y agoI find the dev experience of Angular very frustrating, and many things seem overly complicated or not very well designed, in my opinion. That's why I would choose something else (anything, really) However, if it was noticeably faster than alternatives then I would just deal with those frustrations, personally. User experience (including speed) trumps developer experience.
- EugeneOZ 4y agoDX in Angular is great. With Nx is even better. Prove me wrong with the examples, please.
- cuddlecake 4y agoI'd be more interested in why you think DX in Angular is great (especially with Nx).
- Beldin 4y ago> people have been promoting the idea that the way to fix slow Angular sites is to rewrite them in Next.js, and the data very clearly does not support this. Then again, the data also doesn't refute this. It simply shows angular sites on average score better than nextjs; it does not give any info about the speedup (if any) of rewriting the slowest of angular sites in nextjs. For that, you'd need data on a bunch of slow angular sites before and after their conversion to nextjs.
- chrisweekly 4y agoWhen different architectural patterns are being compared, saying one is "faster" is almost meaningless.
- ramoz 4y ago@alex3917 summarizes in comments below, and what are also similar reasons why I believe modern angular will “overtake” modern react/frameworks like next. Angular in 2022 is simpler than react. It’s what react was in 2015 when Angular 1.x was a complicated and annoying beast. Now, Angular is simple and pleasant; while my scaled, hooks infested, react apps make me feel like I’m handicapping myself.
- hinkley 4y agoIt's very very difficult to get people to adopt systems that have already been labeled as failed. If Angular is indeed simple and pleasant, perhaps there's a space for a clone and a new name, like NodeJS versus Rails.
- ls15 4y agoVue?
- filoeleven 4y ago> Angular in 2022 is simpler than react Surely you must be joking. You have to learn all of these things to make the tiniest CRUDdy app: - angular modules - angular template syntax - angular decorators - angular dependency injection - rxjs I mean, look at the FULL table of contents for their “Get data from a server” doc! [0] I can’t speak about next.js, it doesn’t fit my use case. But claiming that “Angular is simpler than React” is ludicrous. https://angular.io/tutorial/toh-pt6 https://angular.io/tutorial/toh-pt6
- blakblakarak 4y agoIt's simpler once you know it. I bounce between Angular and React and whilst it's true that React is easier to get started, changes in the API (hooks, class vs functional componentns) and ecosystem (eg forms, UI Kits, state management, architecture etc) mean that I find it's a constant learning curve, whereas aside from a few minor changes Angular has been the same since V2.
- findingFounders 4y ago
- tracerbulletx 4y agoI think it would be entertaining to have a recurring competition where teams sign up to compete on a few metrics like performance, number of total features completed, and maybe some kind of code review. Everyone would be given the same project spec and list of features, and have the choice of one of a few different frameworks per contest. So you'd end up with like 10 teams of various quality using react, and 10 using angular, and 10 using Vue or whatever the contest definition is.
- solardev 4y ago> I think it would be entertaining to have a recurring competition where teams sign up to compete on a few metrics [...] Pretty sure this competition exists. Isn't it called "JavaScript"? ;)
- christophilus 4y agoThe “real world” project is pretty close: https://codebase.show/projects/realworld https://codebase.show/projects/realworld
- sarahhudson 4y ago> I went to the Next.js website, looked at some of the logos of the companies using the framework, and started typing their domains into PageSpeed Insights. This is going to be heavily conflated with so much other stuff that is nothing to do with SSR, that it is useless. It is probably more a test of the underlying server performance. And whether a CDN is used (if you use Next with Vercel you will get a CDN, but not everyone does necessarily use Vercel). Also I am guessing PageSpeed doesn't wait for angular to do the client side render? So yes <html><script ..></html> will load pretty fast. Also a lot of NextJS people are going to be correlated with 'build it and ship it quick' bent, and may not tune performance up. I imagine Angular people are more 'long term product' people, in general. Also if you are doing a SPA on Next, you can set up static file generation if rendered page = f(url) not f(url, user_state). Then those can be geographically cached across a CDN. You can do that in a way that say you have product_list.csv, you can build out the static site. I just feel Angular vs. Next = apples vs. orange trees.
- toddmorey 4y agoIn production marketing sites, I've found over and over that it's usually 3rd party javascript that has the most brutal impact on performance. Or put another way: it's less the particular framework you pick and more how you choose to put it to use. (To help address this, the Builder.io team is doing some amazing and super clever work with a library called Party Town that relocates resource intensive scripts into a web worker to free up the main thread.) As others are saying, it's silly to compare frameworks unless it's across projects loading and doing basically the same things. So many ancillary decisions impact the performance. * Not arguing in favor of frameworks here—less javascript is always better! But this comparison method makes no sense to me.
- deleted 4y ago[deleted]
- EugeneOZ 4y agoI guess many people will be surprised by the results of https://github.com/krausest/js-framework-benchmark https://github.com/krausest/js-framework-benchmark I don't even know if they have the OnPush version of Angular implementation (which would be fair), but if they don't - I hope someone will build it soon. ---- And while we are here, please create a Qwik implementation!
- strangescript 4y agoThese comparisons are generally pointless for a variety of reasons. BUT, Angular's dev experience is garbage, and no amount of hot take analysis will convince me otherwise.
- NoNameProvided 4y agoAn honest questions: How much have you worked with Angular? I have worked with it since the first release and what I see that it is steadily (albeit sometimes slowly) going into the right direction. Today the dev UX is great and differs nothing from that of using CRA for example. (If we are talking about tooling)
- findingFounders 4y agoi think it's when you try to build something complex with angular that you can see advantages come to fruition. the opinionated structure can be quite an advantage when you're working with bigger teams/projects, as it can keep code more consistent/familiar/predictable, so when revisiting a project a few months later, you generally know where to find things quickly
- teen 4y agoaverage time to interactive says 19.2s. that cannot be trusted at all
- davidkuennen 4y agoHere an example of my own website with SSR: https://stockevents.app/en https://stockevents.app/en I simply use React's build in solutions[1] and a node.js server. I dare say it's quite fast. [1] https://reactjs.org/docs/react-dom-server.html https://reactjs.org/docs/react-dom-server.html
- mcintyre1994 4y agoAgreed it's really fast. FWIW I think the main benefit you'd get from using NextJS (or similar) is that your header/navigation wouldn't be replaced on page navigations on your features/assets pages, so you wouldn't get the whole page flash. It'd just update the content part instead. Their docs are a good example of this: https://nextjs.org/docs/basic-features/pages https://nextjs.org/docs/basic-features/pages - if you click links on the sidebar you'll see just the content update.
- AtNightWeCode 4y agoOne of the main benefits of next.js and similar tech is that you can run a decent sized site from a 20$ cloud account.
- trhoad 4y agoYou can run a massive PHP application on a $5 VPS without many issues at all...
- AtNightWeCode 4y agoYou can also run a PHP app on an old school web host. In comparison to the demands of modern sites it is not really an option.
- farmin 4y agoAngular is boss. I love having a powerful opinionated framework that has business logic separated from ui so well. Long live Angular.
- rk06 4y agoWhat you have is "statistics". mostly known for infamous quote. "There are lies, damned lies and statistics".
- v0idzer0 4y agoI don’t understand the point of takes like this. The sites are all on different hardware in different data centers in different locations performing different tasks. Even the frameworks compared aren’t comparable. Angular should be compared to React. Not a client+server hybrid framework that utilizes React for UI and mainly exists to simplify tooling and code-splitting. Even if this comparison were relevant, the idea that you should choose a technology based on the minor variations in perception of performance of one person in one location is absurd. This is coming from someone who has had performance issues in Next.js and Angular. Both of which had little to do with Next.js and Angular.