Comment by tticvs

2 years ago

> very few programmers are typically interested in having their opinion on typing changed. Most programmers find themselves drawn strongly to typing or not quite early in their career, and then spend the rest of it rationalizing The Correct Choice to themselves and others.

He's certainly right about this. I can't wrap my head around why anyone wouldn't want types in their program*

The types still exist you just didn't write them down! Why won't you just write them down!?

*short scripts excepted

I actually don't relate to this statement at all. My college courses were filled with Python, Java, and C#. I loved python. I hated C# and Java even more. I learned PHP in my own free time. I then went on and happily cut my teeth on dynamic languages for the next decade.

I dabbled occasionally with typed languages, but it wasn't until Typescript was forced upon me by a respected coworker that I was able to recognize type safety as a net-win for development speed. Seeing an entire class of problems disappear in a codebase rife with them was an eye opening experience.

I briefly took a ruby job a little over a year ago and I missed type safety quickly. Despite how much I love Ruby, I love tracing through code paths to understand what a variable is a lot less.

  • I think typescript's type inference and structural typing is a big part of how it doesn't get in the way of writing code. I've always preferred the safety of static language, but understood the productivity benefits of dynamic languages. With typescript I feel I get the best of both worlds, as you only need to add types where they're vague, and structural types let you express more in objects without needing heavier class polymorphism all over the place.