Hacker News new | ask | show | jobs
by silverbax88 1096 days ago
When I learned React after two decades of web programming with C#, JS and even older tech like ASP or JSP, it was an effort. React has a LOT of stupid in it, but it's still got some great features.

Next.js fixes quite a few of the initial problems with using React even though there's still some stupid and even some new stupid introduced.

I'm definitely building in Next.js now, not vanilla React.

I think the problem is that SPAs are limited in use, but a lot of devs ONLY build SPAs and that creates a mess. Before Next.js, if I was building anything other than an SPA, I'd really have to wrestle with if I should build it in MVC or React...because it was a lot more trouble in React to do it well. But I don't have that problem with Next.js.

I suspect that people struggling to work with Next.js from React don't have the experience of web app development before React existed, so suddenly they are faced with the same learning curve of people who had to figure out React when they were used to full-stack development.

2 comments

In fact it's quite opposite. App directory has lot of quirks that I learnt building in it after experience in react. Just after using it for two weeks I found there is no global 404, you can't use things like window and document, server components are close to useless where you can't even read cookies in server component(you can't read it in client component in server as well even though next has it), it's better to stay away of API routes, you can't use environment variables in prod but you could use in dev, you could easily trip yourself by using 'next/router' instead of 'next/navigation' etc.
Sorry, yes I think I tried that in client component and failed to use it in prerendering step or something(I could still be totally wrong, as I said I just spent 2 weeks in next app directory)
Can you just mix and match the app router and the page router?

I'm not actually sure what the value of the app router is, but the page router works well and is more mature.

> I think the problem is that SPAs are limited in use, but a lot of devs ONLY build SPAs and that creates a mess.

I am lead on an enterprise Angular project and among the reasons I went for it was due to the fact is is opinionated, but is doesn't get in your way. We're on Angular 16 now with a C# back-end and everyhing is going well, is logical, and performant.

Prior to this I was fully in the Microsoft ecosystesm, from ASP classic, through ASP.Net Web Forms, and through MVC.

This was the first project I decided to use a SPA front-end with, wanting to avoid Microsoft's latest Blazor push. It was too early to risk it.

SPAs have their place, and this is a large and complex system.

I agree that React is overused, it seems like it's the "go to" for many people, such as people who are either self-taught or went to a React-focused bootcamp. I've seen plenty of React sites that could be static HTML ... some of them could probably even get away with no JS.