DEV Community

loading...

Is django underrated and node.js(express.js) overrated ?

soumyaranjannaik profile image Soumya Ranjan Naik ・2 min read

I was recently working on a project recently and one of my friend asked have you ever used express.js ? While I have asked node/express vs django question before also this time I was really interested in checking out what am I losing/missing by not using express.js because I have been working on django for nearly 2 years now I have faced this question several times.

Hence, I decided to give it a spin and guess what my experience was...I was like what the heck is this. I was shocked with the amount of the configuration that was required just to get the project to basic working condition with authentication and user creation.

I also used typeorm to generate a default template for starting a express project with typeorm and experess Router.

I tried passport.js for the auth and the setup required for that was way more than what I would expect and configure for any django project.

Yes, I felt the amount of flexibility that it offered but also felt the amount of work that each response required to get desired result.

While this is only my experience I don't know if it is that people who know frontend and just preferred to use the same JavaScript or TypeScript for backend and made node.js or express.js popular or is there something that I am missing or have I taken a wrong approach or did I choose it for a wrong project (my project relies too heavily on database transaction and updation).

Maybe I am too comfortable with django but I felt that anyone would be way faster and also would write more DRY and modular code wile using it but I can see a lot of people learning node.js and that population is way higher than what I can see for django.

So, is there any aspect that I am missing ? or was my application domain not suitable for node.js because I can see Coursera using it and at the same time I can see Udemy using django for almost a similar application domain of video tutorials and courses.

While there were many tutorials for auth and middleware for express.js those weren't as simple to implement as they were on django.

And yes I missed the inbuilt admin panel very badly while trying to build express.js let alone the class views and viewsets which handled a lot of error handling by default for me.

If I was wrong on any approach somewhere or if someone has worked on both technologies can they please share their views and experience in the comments.

Discussion (10)

pic
Editor guide
Collapse
karandpr profile image
Karan Gandhi

I have worked in both technologies and I do find Django as a robust full-stack solution. Express is more like bring your legos and build it but you do get a feeling of superior control.

In my opinion, it's more related to hiring practices rather than technical superiority.

A Django developer would need a dedicated Frontend guy.
A JS developer can work on frontend and backend both.
So effectively a full-stack JS is just more lucrative to hire than a dedicated set of developers.

Collapse
soumyaranjannaik profile image
Soumya Ranjan Naik Author

Ohhh I see. That means it's the industry who did this trend not the developers.
Thanks for the insight.

Collapse
haruanm profile image
Haruan Justino

I think what happens is that express.js is more related to the python/flask way to do stuff, Django is way more batteries included, and this can be good if you don't need to know everything that happens in the process.

Collapse
soumyaranjannaik profile image
Soumya Ranjan Naik Author

TBH working on express felt a lot like reinventing some parts of the wheel and instead of working on developing real solution.

It was something where I lost what abstraction means and flat wan't that hectic or maybe the structure of the JS and TS is like that it starts feeling too much or some specific paradigm that starts feeling very clumsy (especially something like callbacks).

I have done some experiments on flask but it wan't that much hectic while doing stuff although there was a bit more verbose coding than django. I really hope someone builds something like django.js 😁 or atleat I would try starting such an project.

Collapse
aghost7 profile image
Jonathan Boudreau

You're comparing apples to oranges. Dgango != node. I work on node and haven't touched express in years. Even if you prefer microframeworks, express is no longer a good choice.

Collapse
soumyaranjannaik profile image
Soumya Ranjan Naik Author

Shit, I didn't have any idea that it was this way. I thought express.js is the most famous and most popular one for backend node.js development so I was using them interchangeably.
Sorry if I made a mistake in doing so but what would be the one that you would suggest using if someone tries to get into the node.js backend ecosystem. I am just fed up with the amount of config that makes me slow in spinning up a basic working backend with express.js

Collapse
aghost7 profile image
Jonathan Boudreau

It is the most popular in terms of blog posts, but personally I think most people professionally have moved on to other frameworks like Koa or NestJs. For the authentication, were you using passport?

Thread Thread
soumyaranjannaik profile image
Soumya Ranjan Naik Author

Yeah, I was using passport.js but still it was kind of difficult to setup only because of bad documentation, lack of examples and inconsistency in documenting different approaches.
I did try nest.js and it is actually well structured and more modular than the approaches used while using express.js.

I really hope nest.js grows in popularity (or something like django.js comes into existance πŸ˜‹).

Collapse
naolchala profile image
naolchala

I think Django is Angular for Backend, it scares of beginners. I think that's why beginners use React and Express Mostly

Collapse
soumyaranjannaik profile image
Soumya Ranjan Naik Author

I don't know if comparison with angular would be the best way but yeah it is similar in approach of having everything together.
A proper comparison with angular would be something like nest.js which follows almost same approach as angular.
Yet my argument would be if something just asks you to write a lot of verbose code and do something that can be done without reinventing the wheel then why is the approach of reinventing the wheel being more popular instead of the approach of building solutions to real problems.