Skip to content

Comment on Ask HN: Will we see a TypeScript for Python?

Comments

JS doesn't need TypeScript. When's the last time TS saved your JS project from disaster?

typescript isn't about saving a js project. its best when you get it at the beginning. where you can provide hints to your debugger and have type checkers that catch bugs proactively. you can just as easily any your way out of all the benefits.

Sorry if I'm being pedantic, was just responding to OP's phrasing of static typing being a "need" despite JS and Py having come so far without it. I'd say it's situational at best, and "you can turn it off" is probably TS's best feature.

If you're starting with TS, you can't really tell if it's useful or just a chore. I started a large Node project that a teammate moved to TS, saying the same thing about any that you did. I thought it'd be like Rust where it figures out the type for you, but no, any spreads. We replaced all those with explicit types, and I was writing fresh code in TS, but I realized it wasn't preventing any bugs that our integration tests wouldn't catch. It was just wasting my time with verbose types for things like SQL result rows that you could obviously tell were fine from the context. The other guy spent a ton of time fixing our build/deployment for TS, something that's taken lightly until you actually do it.

The project was pivoted for unrelated reasons, and I was left alone with it. I finally took it back to JS when I reached my last straw with TS, finding that it breaks the built-in Node profiler. Overall my velocity improved going back to JS. If TS were truly useful in that scenario, it'd be worth its weight for the reduced bugs that cost time to fix, but it wasn't.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.