A non-goal is to apply a sound, approvably correct type system. Instead, they want to strike a balance between correctness and productivity. And all those little errors that you just saw come from exactly that line. Um, they put productivity first. And with that, yeah, there might be a couple of patches where, you know, things might not end up as they should be. Um, but still you, you make the decision to put the line in your code. So you are the one responsible for that TypeScript, you just need to know about the trade off.
And there's a big trade off in TypeScript that, you know, stuff might not be provably correct in the type system. And you might say, but, but, well, why, why do we even bother if they, if they're not making it provably correct because the main goal was always to make developers productive. Um, I gave the same talk in front of 4,000 people, um, at the V8 Developers World Congress. And I asked two questions to the audience. Question number one was who is, who is using TypeScript in a room with 4,000 people? Over 90% were raising their hands. And then I asked him, does anybody remember a type system called Flow? And it was three people, three people in 4,000 remember a type system called Flow, which was Facebook's answer to TypeScript. Very similar in syntax, very similar in features, but the Flow folks had the goal of having a provably correct type system and thus killing productivity for everything else. And we see what has prevailed over time. As much as I like Flow and I know people from the Flow team, I know what they worked on and how they approached them. It's a beautiful type system. But this little decision to put productivity first is what made TypeScript so popular in the end. And this is the point of my talk. The point of my talk is that, if you use TypeScript, please love it as much as I do because, seriously, I love TypeScript and it's so great to work with. But be aware of the trade-off that you're making. Be aware that the type system might work differently than you expected and it's still your duty to learn it.
It doesn't take away the responsibility of learning a programming language just because you get such excellent tooling. And this leads me to the one learning that I want to transport to you, which is the one thing that you should take home. Be pragmatic and be aware. Choose what works best for you and your team. And if you don't have a team, you have always future you that you need to work with. You're never code alone. Don't listen to dogmatic advice. You know, it's so easy to make, I don't know, I guess it's TikTok where you have to, I don't know, or tweet or whatever, that gives you this one beautiful, fantastic advice that kills everything else. But then, you know, it's just another decision that somebody else made for you. Don't listen to dogmatic advice. Always question everything, validate it against what you need to do. Be pragmatic, be aware, make decisions, well-informed. And with that, I want to say, thank you very much for listening to me. Thank you very much for meeting me. I hope you had as much fun as I had.
Comments