The honeymoonI first wrote some node.js code back in 2010 when still smelled fresh and I was excited to use the same language on the front and back end. It introduced me to sockets and I build a fun little browser game with it, but I went back to good old PHP pretty fast. The problemsAfter landing on a node project in 2015 in a professional capacity, I found out what a pain in the ass it can be. First, in the early days a typical node app was callback hell with zero type safety. Runtime errors galore that were being eaten somewhere in the callback stack. After we got async/await and TypeScript, the user experience improved significantly. We could build more complex apps and not shoot ourselves in the foot. But npm was still a mess and getting TypeScript to transpile properly into vanilla JS was still a nightmare. Not every library had a TS module, so sometimes you were left with a chunk of your app in vanilla JS. ScalingIt's impressive how fast node can be, considering it's single threaded nature and that it's running on v8. It can hold its own. You need to prepare your app to scale horizontally and run one instance per-cpu core to scale. Then there are the memory leaks. Even if you are careful that event listeners get removed, you clear intervals and handle objects properly, it will still slowly get out of hand. No other way around it but to monitor and restart the offending instance. Quality of talentFor many people, JavaScript has been the only language they know. This lowers the barrier to entry, because anyone can write code on the backend. That does not mean that they know what they are doing, which compounds the problems that node has. The thing is...If you take care of all the precautions, get good people, structure the app well, monitor it, you can get a great and performant node application. My problem is that most of the time it feels like you need to fight it to get it to do what you want. Full-stack, opinionated frameworks like NextJS, Remix and NestJS are great in getting rid of many of the downside's I've listed. They come with batteries included, have TypeScript by default and have a preconfigured build process with Vite or webpack, so you don't have to pull your hair out trying to figure out that voodoo. For some types of projects that's ideal and I like to use NextJS for building websites. But if you are building a pure backend API and the frontend code won't live right next to it, there are better choices than Node. Alternatives are calling and I guess I'll just give them a Go. Yours, Taj |
Hi, I’m Taj Pelc. I write about technical leadership, business mindset and enterpreneurship. Daily advice on building fantastic tech teams that deliver great products. I'll see you inside.
I wanted to get experience with the Telegram app ecosystem, so I build a very basic Flappy Bird clone (https://t.me/flappster_bot?game=flappster_classic — you can try it out here). The prototype had to be up and running as quick as possible and I wanted to test it through Telegram which expects the game to be accessible at a public URL. For development, I'd love to skip a deployment step and serve it right from my machine for fast iteration. I could punch a hole through my firewall and lose...
Generative AI tools are getting multi-file editing capability. It recently got introduced to GitHub Copilot. It's already in Cursor and my current favorite, Cline. It can implement a feature across multiple files, but it's still bound to the token limits that the LLM it's using has. Adding a parameter to an API response and modifying a few files to pass it along is cool, but forget about building the whole application from a prompt. (For all but the most simple apps) The limiting factor is my...
Do you know why velocity slows down when you add more people? If I do it myself, I just open the editor and go. If I have to explain what I want to you, my words are being transmitted to you at 120 bits per second (at a normal speaking pace). And that assumes I made it clear on the first go and that's just not how human conversation works. We're going to have a bit of back and forth. You'll ask me if you understood me correctly, I'll explain more, bitrate drops. And this works fairly well. As...