HACKER Q&A
📣 marcus_cemes

Should I convince university against Node.js, maybe Rust/Go/Elixir?


I've been using Node.js and Typescript for many years, and I'm constantly frustrated when hitting issues with npm, the memory usage, bugs in libraries, the state of the web framework ecosystem and so on... I've been hired by a university course to make a full stack application to manage reservations. I've been very happy with Svelte in the past, it's a breath of fresh air, but I'm torn for the backend. My recommendation was Node.js, I'm very familiar with the gritty details, and it's easy to pick up when I leave. I also tried using NestJS and Prisma for a second time, and despite the amazing work that has gone into them, it's still painful for me to use when straying away from the "chosen path".

I also recommended Rust (been using just over a year, I've loved it so far, compiled code feels so much more powerful than janky and fragile dynamicaly-typed languages), Go or Elixir+Phoenix (anything to get away from Node.js, but they are all quite different), but my supervisors aren't too keen on a new language.

I'm not after performance, but a clean and maintainable architecture. I've heard good things about Django and Ruby on Rails, although I'm not particular keen on either. PHP would likely not be suitable, it has to do some background processing work. I feel like I could make any language work, it's just Node.js' dependency problem that gives me nightmares.

I would value some feedback or advice, I'm doing my head in with decisions.


  👤 jeremychone Accepted Answer ✓
Here are some random points, but you have more context at the end, so make the decision that fells right to you.

- I heard a lot of npm dependencies nightmare, but somehow, we do not hit that much. Once in a while (a couple of months at most), we get some weird errors, delete node_modules, and are back at it. IMO, TypeScript is a must for any code > 10K LOC (and I use it even with 100 LOC).

- NodeJS/TS's benefit is that it is the same language for the backend and frontend, allowing students to focus on the patterns rather than learning another language.

- However, I love Rust, and I think it is an excellent fit for cloud/web backend. We are moving our NodeJS/TS backend services (web service & job service) to Rust, at least for new ones. Still working on the blueprint, it is quite an effort, and the big question is how long it takes for a whole team to learn Rust well.

- If the university understands the pros/cons of Rust and want to "invest" in it, it might be a good idea to have a Rust backend. However, if they have no clue what it is, it might be too early for them.

- IMO, Rust will become more mainstream in the years to come, especially for backend services. It might take 5 to 10 years, but I hope and think it will get there.

Those are not recommendations, just thoughts, as this is a very contextual decision.

Best of luck, I am sure you will do well, you seem to have all of the right questions.


👤 NathanKP
I may just be an old school Node.js developer but I don't like using frameworks like NestJS and Prisma. Like you said they don't give you very much flexibility outside of the "chosen path".

I think in order for students to learn they should be using lower level packages directly. So something like Express or Koa + the SQL driver directly. Learning the core concepts underneath is more valuable to students than learning a specific ORM or framework that abstracts all the details away.

Learning how to deal with dependencies is a similar thing. I don't think any course would be complete if it teaches Node without also teaching how to build a Dockerfile to package up your application and the snapshot of it's NPM dependencies as a container image.

Building a compiled binary with Rust or Go is one language specific way to solve the problem of packaging dependencies, but you have an opportunity to also teach students a general purpose tool like Docker container images, which can be used to solve lots of different dependency packaging and distribution problems, not just for NPM, but also your static files, your specific runtime binary versions, any system packages you might need, etc.


👤 breckenedge
> and it's easy to pick up when I leave.

Your head is in the right place. Use whatever you think is going to be the most maintainable by your successor. Only you can make the right decision. Every ecosystem has warts, there are no silver bullets.


👤 mewpmewp2
I have been doing NodeJS, TypeScript full stack for quite a while now. I haven't really hit any issues that you are describing of, honestly, so I would just go with Node.

👤 slmjkdbtl
Not a tech stack recommendation, but I'd suggest teaching from putting together HTTP response strings, and build their own abstractions / tools from there, instead of going straight into libraries like express / koa (e.g. i think the middleware architecture hardly makes sense for people who don't know the inner workings of a http server). Same with frontend I think it's better to start from putting together simple html string from the backend, experience why it can be tough for building rich applications, try to build own mini / frail tools, then move to the established frameworks. The gist is: Understand the problem before learning the solution.

👤 aww_dang
We all have our favorite stacks. I think at the end of the day you want to use Rust, which is fine. It is new and interesting. I'm getting into it as well. You just need a way to rationalize it in the institutional setting.

👤 kody
I would agree with Svelte for the frontend. I would teach Go for web server fundamentals or Python + FastAPI for quickly building a backend.