Web development feels extrememly broken lately, and I feel the need to write about it. The potential of the web for enabling software development is enormous, but we are not headed in a good direction. My growing list of issues is thus:
const myArray: Array= [1, 2, null, 3, 4, 5]; const maximum = myArray.filter(x != null) .reduce((x,y) => x > y ? x : y);
The current TypeScript compiler will complain that x can be null, even though we have an extremely obvious filter for this. This might sound like a nitpick, but this is one example of a broad problem: TypeScript has too many false positives and negatives to be significantly useful. TypeScript does make you code noisy though, and introduces a build step that is often slow enough to compete with much better languages. I have not doubt that TypeScript has prevented some potential bugs in codebases, but it comes at significant cost. I would much prefer that web apps are built with a thin layer of vanilla JavaScript calling into WASM for mission-critical logic (written in one of the myriad languages that now offer WASM targets).
Dependency management for the web ecosystem is a nightmare. It is a well-established joke that node_modules frequently exceeds multiple gigabytes for relatively simple web apps. This is before we consider the security concerns. Deep dependency trees make it difficult to establish the providence of code, and packages can be compromised. Companies will tend to out-source as much of their codebase as possible to external dependencies to reduce labour. They are eventually burnt when they realise that it is untennable to build a business by glueing 100 small projects together by hobbyist and volunteers. This is not an argument against open-source per se. Only that the fragmentation is wide, and the quality is low. Newer package managers like pnpm and bun seek to replace npm as a CLI, but they mostly allow you to do the same things but faster. I do not expect successful future software projects to be built on an increasingly tall and unstable Tower of Babel.