Hacker News new | ask | show | jobs
by wonrax 626 days ago
> I feel a lot of anxiety when I'm forced to touch fragile bits written in Ruby, Python, and JS.

I resonate with you even with TypeScript, since it's just annotating types but not the true value under the variable. You would have to go to a greater extent to make sure that everything from outside (library code, parsing HTTP responses, database queries, etc.) conforms to your annotated types. Even in the same project code created by other people, I often doubt the validity of the types, asking myself questions like: Should I validate this? What if this has already been validated, thus making mine a performance waste? Does this object contain extra sensitive information that could be leaked when used in a logger?

After having experience with Rust, working with TS feels like navigating a minefield where every refactor could detonate hidden bugs or behavior collectively accumulated by all the historic code and dependencies, small or large.

1 comments

I haven't had this experience with TypeScript. In the projects I've worked with, we turn on strict mode and heavily discourage using `any`. I generally feel pretty confident that the type annotations match the runtime values.