Side-effects (aka I/O) can make your code hard to test, understand, and change. In web dev, you have 3 options:
- Use languages that don’t have side-effects; Elm for UI, and Roc for API/CLI.
- Abstract away the side-effects using Effect-TS.
- Use Functional Core, Imperative Shell in TypeScript, which requires you to manually separate pure code from side-effects.