Hacker News new | ask | show | jobs
by iamsaitam 699 days ago
The malicious beauty of typescript is that at any point you can just declare something "any" and voilá, the guard rails are off.
1 comments

It’s fine to have an escape hatch when you can’t figure/don't care about types (yes sometimes you should use unknown but that’s another topic)

But at least TS forces (if enabled by strict flag) you to explicitly mark all those places. You can always revisit them later.

Case in point: I’ve written A LOT of redux-saga code and figuring out types for that was exceptionally difficult for me. Sprinkled all that with a ton of anys. Had a few bugs but not anything serious.

Finally rewriting all that slop with async-await and am really happy about it