Greetings colleague!
About a year before this article was written, it began to feel like I was starting to burn out. Work, long ago turned into a craft, has ceased to bring that student feeling of pioneering, familiar to every programmer, bringing euphoria. For the sake of this feeling, for the sake of new knowledge, I once sat at the monitor for 18 hours a day. It's long gone ... but recently I experienced this feeling again! At first it was quiet, unusual due to a long break, but over time it flared up and burst into flames!
If you are the same as me, a programmer with about 12 years of experience, about 30 years old, lingering in your own stall stack (especially if it is C # .Net MVC), then I invite you under cat. For those who are younger, I think it will also be useful to be ready in advance.
The background begins with the fact that I have been developing on the C # .Net stack (ASP, MVC, windows services) for a long time. It seems to me that I can be called something like a full-stack developer: databases, backend, frontend and even Olympiad programming - I passed all this through myself. I won't say that I am a professional, but it is difficult to surprise me with something when it comes to .Net. No, I did not attend .next conferences and the like, but I studied with several old-timers at the university, I know some of them personally, and the number of medium-scale projects I have launched in PE has exceeded 30.
As it was indicated before the kata, it seemed to me that I burn out. When a new project was brought to us for implementation (not too big - this is important!), Already at the first meeting I knew what and how we would do - boring.
Don't you recognize yourself yet? If you are younger, be sure to keep reading, you have everything ahead of you. If you have gone further than me, keep reading, and in the comments tell us about your experience.
So, I had about half a year of uninteresting work ahead of me. But we completed the project a few months earlier, learned a bunch of coolest things, improved in related areas and had a lot of fun! I won’t delay ... the new project was made on a completely new stack: Node.js + React.
Colleagues, foreseeing the hap, should immediately make a reservation that the decision to change the stack did not come spontaneously. For several months I have been carrying the idea that .Net MVC is not the best choice when it comes to small projects. I was looking for alternatives, looking around. About the combination of Node.js and React, I thought that these are tools that are more sharpened for server-side and client-side than C #, but already the first experience exceeded all my expectations.
Let's stipulate the rules
First, I consider it necessary to clarify some details and conditions under which the key idea of the article - replacing the .Net MVC stack and Node.JS + React - can be considered correct. I am not inclined to go to extremes and argue that such an event will be useful in all cases, so here is a short list of the initial restrictions:
- Projects involving up to 3-5 programmers;
- Lack of essential calculations and complex logic in the backend;
- Availability and / or need to unify backend and frontend;
Projects involving up to 3-5 programmers
This limitation arose due to the assumption that when a large team of 5 people or more participates in a project, we are talking about serious enterprise applications that would be difficult to implement without the advantages of .Net (and not only ASP.NET, but also Core). We'll talk about the advantages and disadvantages themselves below.
Lack of essential computation and complex logic in the backend
Using JavaScript (or even TypeScript, it won't save you), a dynamically typed language without multithreading and without Linq, to implement computations or more or less complex business logic, is simply impossible - the language is simply not designed for this. The same cannot be said about C #. It is important to take into account the specifics of the instrument so as not to hammer nails with a microscope.
Availability and / or need to unify backend and frontend
Unification will help lower entry barriers, budgets and deadlines. But the stick always has two ends, and a rash step on the part of "effective managers" without real need can lead to losses.
With these limitations in mind, I suggest the following checklist, by going through which you can assess the applicability to your ecosystem of projects.
Check list
Development and maintenance cost
Does your budget require a low talent bar and low maintenance costs?
If you have a small company or a team of programmers, the complexity of the development tools takes up precious resources. The Node.js + React stack has a number of distinct advantages over .Net MVC or Core:
- Unification of backend and frontend - specialists will be able to work as a full stack easier and easier than if it was a C # stack;
- Less server resource requirements - Node.js is not as gluttonous as .Net and is truly cross-platform;
- The development speed is higher - due to the lack of typing, the release rate of the first versions of the product significantly increases.
Launch of MVP (minimum viable product) and PoC (proof of concept)
Are your deadlines for an MVP or PoC launch?
In terms of the speed of implementing MVP or PoC, the Node.js + React stack is undoubtedly in a better position than the .Net stack. Taking into account the previous point about the cost of development and maintenance, synergy appears for the task of launching an MVP: fast, cheap, efficient. In addition, the stability of Node.js is at a high level and is not satisfactory.
Development environment
Will the functionality of "light" IDEs be enough for you?
Lightweight IDEs are great for Node.js in conjunction with React. For example, VS Code does not require a lot of power during development, a cross-platform editor, distributed for free, its functionality is quite enough to comfortably develop both backend and frontend.
For projects in C #, you can use Visual Studio Community - also a shareware IDE, but it will already require resources, will not be as fast and not cross-platform.
Language typing
Can you provide high-quality development and support for your project, given the lack of typing?
Lack of typing in a language is a double-edged sword. On the one hand, this approach allows you to multiply the development speed by reducing the amount of code. On the other hand, the volume of testing is multiplying. In addition, some errors may appear only during operation, successfully passing all tests. It becomes difficult to do large projects without typing.
Performance and scalability
Are you ready to ditch full multithreading out of the box? Does your project lack complex calculations or business logic?
As you know, Node.js implements a single-threaded event-driven model. This is great for a large number of queries, but not at all suitable for parallelizing computations or implementing complex business logic. Thus, when choosing a stack for a backend on Node.js, one must be aware of the nuances of its work.
Cross-platform
Need cross-platform out of the box?
Yes, under .Net there is .Net Core, which claims to be cross-platform. But it's still not .Net MVC. If you have assembled a large amount of ready-made components for .Net MVC, then the transition to .Net Core will not be easy. Using Node.js you don't have to worry about it and use your developments for any platform, depending on the customer's requirements.
Conclusion
The rich world of Node.js modules will allow you to efficiently and cost effectively implement almost any application task from authorizations in corporate systems and rest-api to chat bots of messengers.
Deploying Node.js apps on any OS is a pleasure and a couple of commands. And the need for server capacity can be reduced by an order of magnitude compared to .Net, and you can safely choose "pay for resources" in our dedicated server configurator .
Have you tried to change the stack?