I did a bit of fullstack development

Published: 2024-04-27

Last weekend I did a bit of "fullstack" development (i.e. a bit of frontend, backend and deployment) using supposedly modern tools in JavaScript (namely NextJS, Prisma for the DB backend and Docker for the deployment). These tools for this project were somewhat thrown at me without a lot of discussion, so I just shrugged and said OK. It was a longtime I hadn't touched that stack and now I remember why. It's still the unpleasant developer experience I recalled.

I have strong opinions about this stack, it's important for me to write them down so at least I will warn my future self to avoid it in the future if possible.

§ What's wrong with "fullstack" development?

I believe that JavaScript - taken as a mere programming language - has its "sweet spot" for scripting stuff running in the browser. The language itself has its quirks (luckily I rarely stomp on them, besides the occasional !== operator, which still irks me) but it's not bad compared to others I have encountered. I see it more like a technology to support web sites, not to be used to create monsters (you all know what they say about hammers and nails, right?).

JavaScript is easy to learn so here we are with people forcing a square peg into a round hole, pushing JavaScript to do more than it was thought of. Namely, complex web applications and (ugh) backends. I am not complaining about things like scalability or performances (don't have data points to support such claims), I will just look at the overall developer experience. The basic issue is that when I see a technological stack that grows forever, adding layers over layers of abstractions, complicating the developer workflow - all this is for me a strong sign that something's wrong. That things just do not work so workarounds and hacks are needed to make them work in an acceptable way.

There are many memes about npm and NodeJS and probably many people have a laugh and accept this ecosystem as a fact of life. Personally I don't find anything funny about that: I see instead a stack that has grown well over its intended scope and we have a bus that has hit a wall at full speed and we are at the incident site trying to help survivors.

More specifically, this is a non-exhaustive list of observations that are telling about things being so bad.

§ The icing on the cake: Docker

Oh, almost forgot. Arm in arm with the JavaScript ecosystem we see glorious Docker containers.

Even basic system administration is not cool anymore. Now we ship these monsters on a cloud server under the assumption that sysadmin work is obsolete.

Docker is also another clear sign that complex systems are unmanageable. I can't forget this meme:

How Docker was born

I had a local image of Postgres with a script to initialize the database, in the directory it should be so it is automatically picked up on the first server startup. Works on my machine but on the server the initdb file is ignored (here where it happens). Why? No fucking clue.

Solution? Create a custom Postgres image and inject the initdb script:

FROM postgres:12

ADD ./scripts/init.sql /docker-entrypoint-initdb.d/
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 5432
CMD ["postgres"]

§ Conclusions

I'm not updated on the new iterations of the frontend ecosystem (Svelte? Deno?) so I can't say how the future will be. But one thing is sure: next time I will have something to complaint about Rust, everyone please remind me of this weekend doing NextJS with Docker.