Readit News logoReadit News
qwertyuiop12 · 3 months ago
Probably in the past a strong typing system was a good deal. However, when you growth, it has many advantages having a type system which lets you change whatever you want without fighting against the compiler/transpiler. So useful for debugging and hacking purposes.

Also, as you experienced, you can implement new "language restrictions" using zod or new lint rules. Making your project more resilient to version updates and creating your "language superset" that can growth with you.

jfengel · 3 months ago
You should avoid "any" like the plague. I strongly recommend putting that into your linter.

Unknowns are also a code smell. I'm not sure they're ever necessary, but they can save a lot of grief when fighting with the type system isn't the best use of your time.

As for exceptions... I agree, but a lot of programmers hate checked exceptions.

I will add one beef: fetch should return unknown rather than any.