I have been using both of those 2 awesome technologies for some time. From the point I started using React, I had a slow migration to the JS ecosystem and started to do more frontend work and less backend work using .Net.
Lots of folks like ASP.NET Core. 🌟
see the 2020 stack overflow dev survey
In this article, I don't compare them - just telling a few my personal impressions of both ecosystems.
It's mostly about what I like or dislike about both the ecosystems & their tooling. 👀
Why those two?
Both React and .Net Core are baked up by tech giants. 🗿 This makes picking those technologies easy for decision-makers.
The React ecosystem
React is the dominant go-to solution when it comes to building web applications.
- the ecosystem is huge and more vibrant
- great tools are free - ESlint, Prettier, Typescript, HMR (hot module replacement) - the JS community really has the lead when it comes to DX
- Monorepo tools
- An inclination towards FP (functional programming) instead of OOP (object-oriented programming)
- Some advantages are due to working with JS - like the ease of using JSON data and doing object manipulations
- More and more traction to Typescript in the last few years - I think this is a great quality boost for the ecosystem
- things get deprecated (see examples below)
- using TS doesn't give that seamless typed language experience (yet) as C# does. TS has escape hatches that can make TS code weekly typed (this can be also a benefit for some people)
- Things move much faster - and it's harder to stay up to date
- Standards are still missing in the React ecosystem. This is a good and a bad thing because each project will look very different - from folder structure to the way components are written, to what CSS technology is used in the project. This is somehow nice because it leaves a lot of room for new innovation, but still, it feels like some standards are missing
Examples of deprecation in the React world:
- You learned React class components years ago and became an expert using them and all the lifecycle methods and all the class-based patterns. Well...bad luck, React function components with hooks are the new standard (don't get me wrong I absolutely love hooks ❤️).
- If you learned unit testing React components 5 years ago you might have learned Enzyme. At least from let's say 2019 (when also hooks were released), Enzyme is not encouraged to be used in React projects anymore. React Testing Library is the new standard, which has a totally different approach and different testing concepts (that are better). To put this in contrast - if you used .Net and learned to unit test your code with xUnit and Moq, maybe 5 years ago, you would still use those and be encouraged to do so
- You learned some complex state management solution and now there are talks in the community that you should not use it anymore - but maybe you should 😉
Examples of missing standards in the JS world: Just to give some context - there are 3 popular bundlers / build tools (webpack, parcel, rollup). There are more than 4 popular Rendering libraries (React, Vue, Svelte, Angular). There are at least 10 different ways of doing data fetching in React (with redux using your own middleware, sagas, thunks, redux-observable, useEffect, RxJs, react-query, swr, etc)
A more mature community who figured out doing things in certain ways. Now the .Net core ecosystem is obviously not as popular as the React ecosystem. When it comes to server-side applications or API's there is no clear winner, but we can certainly say .Net Core is one of the trending top picks in the world of APIs & backends.
- A more consistent way of building server-side apps
- More stability - the best practices you learn today will probably be also around 5 years from now
- Both C# & F# are excellent languages that evolve a lot over time
- It's just great for building Web APIs, background services, etc
- Microsoft owns .NET, so you will get a pretty nice experience using .Net/.Net Core on other platforms they own - Azure, Azure Devops, Github
- Lacks the advanced OSS tooling in the JS world - for more advanced linting, refactoring tools, code formatting you need to pay (ex for Resharper or Rider)
- Lacks monorepo tools (at least I don't know any)
- The community is not so vibrant. And a lot of folks are not so open to sharing things. This ecosystem would have great success if people would be more open and share things more
Is it worth knowing both?
Why? It helps focus on pure coding and avoids learning at first all the complexities of the Web.
Aside from this, it's an incredible stack to master, as .Net Core offers a consistent way to build complex backends, and React helps you build complex interactive user interfaces.
Leave a 🧡 & 🦄 if you like this article, also check out my Twitter where I post more cool content.
👇 Comment below 👇
Let me know what you think about the .Net Core & React combo.
Is it worth learning C# with .Net Core or should we just use Node.js server-side and use the same language everywhere?