DEV Community

Sebastian Wessel
Sebastian Wessel

Posted on

Stop using express.js

I'm so tiered of these "Build your first REST-API with Express.js" articles.
Seems like, writing such an article is the first thing you need to do, and the first application you need to implement is an Epress.js application.

But why?
There are so many real cool frameworks out there, which might do a much better job than Express.js, with support for state-of-the-art patterns like async-await and great communities.
Express.js 5 with async-await is announced since years, and the widely used version 4 is legacy code.
Even if version 5 becomes available in some years or centuries, you probably will need to migrate your code base.

Because of this, I will share some cool frameworks with you. Maybe you like to try them out and write your next article about something, which was not written a hundred times before.

Feathers

Feathers is some kind of unicorn and is focusing on build REST-APIs and real-time applications.
Pretty cool concept and simple to use.

Feathers.js

Hono

My lovely Hono!
If you're looking for some lightweight and fast way to build HTTP server, you must definitely try out Hono.
If you know Express.js or similar, you will exactly know how to use Hono.
It also supports different runtimes like Bun and Deno and allows you to write software, which benefits from the runtime benefits, without the need to re-write things.

Hono

Elysia

Build to get the benefits of Bun runtime, it is a real promising framework.

Elysia

Fastify, Restify, Hapi

If it comes to REST-API, you should definitly look into the "Three-Kings".
They are made for building REST-APIs, and they are also some kind of "way-to-go" with all these features, modules, plugins and communities.

Restify & Fastify
Hapi

Koa (dead)

Koa was a more modern version of Express.js developed by the team of Express.js developers. It provides support for async-await.
But it seems to be no longer maintained by someone

Koa

And much, much more is out there!
So please, if you write beginners tutorials, don't stick to legacy Express.js.

If you come around some cool framework - please let me and the world know about it!
The Frontend guys are having so much progress with React, Angular, Vue, Svelte & Co over the last years, and we backend guys are sticking still in 2010?

Latest comments (173)

The discussion has been locked. New comments can't be added.
Please see my last comment here: https://dev.to/sebastian_wessel/comment/274dk
Collapse
 
frulow profile image
Frulow

You don't want to be standing in a desert when you need water. Everyone knows about alternatives of express.js tho they prefer to use it instead of something else.

Everyone has a demand to fulfill. And when building something that you want to work for the next 6-8 years atleast, you want it to be supported well.

Collapse
 
sebastian_wessel profile image
Sebastian Wessel • Edited

Totally agree with your last sentence.
But in fact, something like Fastify, is for sure well-supported, has a lot of ACTIVE maintainers & supporters & community and is moving & pushing forward as you can see here platformatic.dev

And if you look at hono.dev, as an example, it might be new and might be not bulletproof as express.
But it takes a lot of advantages of newer node version, where you simply do not need additional plugins for some stuff, because they use plain node functionality like fetch streams.

Or something like IBM's Loopback can't be recommended & used in production?

My point is not "against express" - my point is against standing still and staying in that "express"-loop.
If we follow the arguments in many comments here:
We don't use alternatives because they are not so widely used in production by others and haven't become mainstream, write articles about alternatives or extend them with plugins/modules and so on...
...then, nobody does something, anybody is expecting that someone else is doing it, and anybody only wants to be on the safe side, waits to only consume some ready-made mainstream thing which must also be free without any costs.
What the point to have a mindset like:
Ohh a bug - someone (else) needs to fix it asap for me for free
Ohh a missing functionality - someone (else) needs to build it for me for free
Ohh it is not used in production - someone (else) needs to try it and make this mainstream
Ohh not so much documentation - someone (else) needs to write it, while I better repeat to write something about express for to be the 45Mio+1 one

We are developers!
We need to use stuff.
We need to try out a new thing - If something doesn't work, we simply fix it and get the learnings from it.
If there is something we need - we build it!
If something does not fit, we replace it with some BETTER solution.

And the argument, that big companies do not something before it is mainstream is some kind of invalid.
I was more than one project of big companies where they invested millions, only to try out new stuff and new ways - exactly to come out of such loops.
And they needed to invest millions because of that wrong mindset.

And if you work at a company, which has this "only mainstream" mindset - well, you are part of your company in the development department, right?
Who is deciding such stuff? Some CEO or you and your colleges?

Collapse
 
frulow profile image
Frulow • Edited

I understand your point.

Collapse
 
fredericchang profile image
Frederic

Thanks for your information. It helped a lot in my study. I will switch to Hono.

Collapse
 
anodynos profile image
Angelos Pikoulas

Maybe the best of all in terms of features and rear of use is NestJs. Insert the good you get express, but your never need to write in its outdated API..

Collapse
 
tawsbob profile image
Dellean Santos

Loopback is the best, no questions about

Collapse
 
sebastian_wessel profile image
Sebastian Wessel

Valid!
And also provided by the big blue IBM, so nobody should complain “not professional” 😂

Collapse
 
anuragvohraec profile image
Anurag Vohra • Edited

"leave battle tested armour and use this new ones in your Battles!"
reasons for this, i won't explain or elloborate, the only explanation i have is I am sick of your old armours, so do as I say

No!, Thank you

Collapse
 
sebastian_wessel profile image
Sebastian Wessel

🤔 to pick up your example:
Use the stone, because it’s proven that it works if you hit the head.
Do not try out the 🔫 because it was never used in a battle before.
For the stone we have 45mio documents explaining how to use it.
For the 🔫, we only have the manual.

👍🏼 you made it!

Collapse
 
anuragvohraec profile image
Anurag Vohra • Edited

To prove express stone and the framework you suggest as modern marvel, you need provide supporting evidence, we are ready to accept your conclusion, but so far you have not given enough explainations of how express is stone, and others are any better.

 
sebastian_wessel profile image
Sebastian Wessel

Might be the better option, if you try them out by yourself and do your own experiences, and maybe give feedback and let the community participate on your experiences, instead of expecting that I or someone else is doing it for you?
The community of open source developers already provides you the bunch of free tools. Move yourself a bit!

I’m not a priest who needs to do something to change your mindset or to convince you about something.
I’m only a that guy, who is telling you, to not be lazy, and to have a look around.

You need to provide the evidence, that there is nothing better on the planet than express. And this, you should do regularly!
Not for me or somebody else - simply for your own growing and expertise.

For me personally it doesn’t matter and I really don’t care, if you do monkey business with express for the rest of your lifetime tbh.

Collapse
 
smeijer profile image
Stephan Meijer • Edited

"stop using express, because there are so many cool frameworks out there".

It's not always about being cool. Express is proven tech. It works. And for the lack of native async support are easy solutions. There's a reason why express 5 doesn't ship, and yet express is still remains the industry default.

Collapse
 
sebastian_wessel profile image
Sebastian Wessel

So, you mean, it’s better if we never change or improve here and we still start new stuff with express 4.x until end of days? Waiting for someone else to build and release express 5 or whatever for use, while we are browsing cat pics on Twitter?

I only pleased in this article, to not write the next beginners guide for express because there are already 45mio out there and nothing has changed since many years here and reached out for support other stuff.

People arguing, that they do not move from express, because others don’t have so much documentation, articles and this kind of eco system and it is proven to work since years.
Ok valid argument for production critical stuff - maybe.
But also arguing, that they write the next tutorial about express because there is a lot of other material around for this, with the knowledge, that this is is already written in thousands of articles, books and so on?
It’s waste of time.

Simply not using something different, to try it out, and prove that it works as expected - or maybe better - because of the fear, that there might be a bug or a problem?
And the expectation in case, something is not working, someone else needs to fix it?
And someone is meaning everybody except your own - it’s meaning the guys, which are building the stuff for free, while the other ones are laying in the sun - right?

Sorry, but this is not development in my eyes.
It’s standing still, while only consuming stuff from others like vampires with the expectation that someone else should do the job, without money, while they receiving their payment regularly for using the stuff which they get for free.

So here is my question:
What is the expectation here? That somehow, magically over night something new appears and that are magically 45Mio articles and documents for this appear and all others have proved in production, for years, that this magically appeared thing is working?

If no one tries new things out and no one is writing new stuff and no one is fixing and improving something, then there will be nothing new! And bathing will become ever mainstream.

Collapse
 
ragnarok001 profile image
Colter

Well the reason there are a lot of tutorials for express is because there are a lot of users of express. It's also pretty flexible. When you are trying to teach beginners the ropes you don't want to bog them down with excess tool choice. You want to pick one that is going to suit most general use cases and teach that.
The same reason there are millions of beginner java tutorials. It may not be the best thing for many tasks but you can cover concepts with it and it works on many systems.
There is also a ton of additional educational resources for express so when beginners run into a snag they have a good chance of being able solve their problem. You can say you want progress all you like but it won't happen if you teach beginners new stuff that they can't make work for their first project. Beginners become novices then average then expert. If on that journey, their accumulated knowledge demands a new tool it's at that point they should and likely will select one.

If you think otherwise then why don't YOU make these beginner tutorials that YOU claim need to exist to create progress instead of writing an article complaining that they don't exist? All these protester types like you screaming "progress" ad nauseum ironically makes no progress.

Collapse
 
sebastian_wessel profile image
Sebastian Wessel

I would like to give your comment more than one ❤️, because you are one of only a few, which got the intention of this article right and providing some related comment.
You don't know how nice it is for me to read your comment!

It is a valid point, that beginners should start simple and so on.
And my post is not against this.
As you said - there are thousands of tons of articles available for this.
I simply don't see the need to write the same articles over and over again, when a Google search returns 45Mio results on this.
Also, you can start with some other, similar stack - which, very often, - adapts express patterns. This helps newcomers and might be interesting for pros and experienced devs too.

And about your last paragraph:
I don't make tutorials, but I try to push things forward and try to share knowledge and stuff as good as I personally can.
But in fact, these articles and stuff don't make 100 views over weeks and month, while this dump-a*-s* is going into dev.to Weekly-Top-10 with +27.000 views with less than 36h.

You might want to take a look at my open source project at purista.dev or my recent article at medium
medium.com/@sebastianwessel_de/the...
or this one here:
dev.to/sebastian_wessel/awesome-pr...

Collapse
 
captaint33mo profile image
Vibhor Sharma

I regret spending those five minutes of my life reading this article and engaging with the author's contentious opinions. It seems like Dev.to is the new Medium for all these stupidity.

Collapse
 
sebastian_wessel profile image
Sebastian Wessel

Thanks for taking or maybe wasting your time.
I'm kind of totally sorry 🙏 about it, because my intention was different.

My intention was to motivate others to write articles, which are not always the same published since years.

But somehow, this was going into a totally different direction end explodes, while there are articles here, with similar headline and more "contra express" totally invisible.
I don't know what was happening here 🫣

Collapse
 
codejudas profile image
Evan Fossier

Man this reeks of junior engineer puffing up their social media presence with "hit takes" for recruiters.

Collapse
 
karyum profile image
Mario Saliba

There is too many things and stuff in this industry, too many tools, too many frameworks, too many databases. Im kinda glad that at least for the backed there's obvious choice to go to, makes things much simpler.

Is there a better backend framework for my problem that Im trying to solve ? Yeah probably
Can Express still solve it ? Yeah
Do I care then ? No

So thanks for making junior developers who are trying to get into the industry more frustrated with what technologies they should learn.

Now insert comment from Sebastian Wessel under this line, cause my god he likes to argue every comment 😂😂

⤵️

Collapse
 
sebastian_wessel profile image
Sebastian Wessel

It's not about argue against or for something in first place, when I answer comments.
It's kind of being polite.
If someone takes the time, to read something from me, and has some opinion or comment posted, then it is only fair when I take my time to respond.
This is something where, I think, grown people should simply do respectfully. Don't you agree with that?

Also for your comment, which is more than 2 words - I simply say:
I do not agree with that - totally not.
But thank you for taking your time and to share your thoughts.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.