Hacker News new | past | comments | ask | show | jobs | submit login

Sure, like all systems, there are overhead costs involved. But with something like a typed system, the overhead costs are minimal compared to the benefits you reap from them.

One of the projects I worked on during my transition to typescript was to convert an existing project into it. Sure there was a lot of head banging against walls at some point to get the types to work out, but during that process I finally really understood how everything fit together and gained a sense of assurance that I could use a return of a function with complete confidence. Developing on that project afterwards was also a breeze, moving faster and more confidently knowing that the object types were set, and that guardrails were in place to prevent myself from shooting my own foot.

It's a new system to work within the guidelines of, but guardrails are there for a reason, to prevent you from falling off a cliff.




The problem is, Javascript was never meant to be typed. It was never meant for what we use it for, even. When you start adding guard-rails to a language that already has guard-rails, what are you left with?

We spent more time screwing around with our Typescript types, getting the compiler to be happy, working around bugs with type assertions, etc. than we did focusing on the app logic at some points.

This kind of stuff, to compare, never really happens with C++. The type system is simple enough (compared to TS) that you can pretty confidently fix type errors quickly. I don't like Rust, but I know that the same occurs with Rust's type errors, too. Why is TS so difficult?

Because Microsoft created a type system that is so complex it can represent (almost) any type in a dynamically typed language. It's impressive, but not at all practical.


You are either going to catch the bugs in the type checker or you are going to have to write unit tests to catch them.

For me, typed python saves me a bunch of time.


Typed python takes ages to validate, and Python is much slower to run than Node.js, even with hacks like uvloop.

I've barked up that tree so many times, I don't think I'll ever go back to Python for that stuff in the future.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: