Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Case for Permissive TypeScript
1 point by Jaxkr on Feb 26, 2020 | hide | past | favorite | 1 comment
Hi HN,

I’ve been leading development on a large-ish TypeScript codebase. We’ve been having a lot of success with an extremely permissive compiler configuration, and I wanted to share my thoughts.

1. Writing types slows down development, particularly if you’re using lots of local ad-hoc data structures that aren’t reused throughout the application.

2. The best part of JavaScript is its usefulness in rapid prototyping, so it’s important not to smother this with policy.

3. Types are useful, but only sometimes. Forcing types makes the tinkering/experimentation process harder. Not enforcing types at all allows the programmers to exercise discretion, and rapidly prototype workable code.

4. Programmers having discretion over whether to use types is a good thing. Not every data structure needs a type def. TS devs understand that function parameters and reused objects need types, and they can choose to use them when it’s convenient.

TL;DR: I believe TypeScript should be viewed as a set of features to compliment the mature, powerful, and dynamically typed JavaScript language. Types are useful, but shouldn’t be forced.

What are your thoughts on this? Agree? Disagree?



I agree that you need a pragmatic approach to using types. That said, I also strongly believe that meaningful use of TS is a vital requirement for any project that will be maintained over time or involves multiple people.

I wrote my thoughts here:

https://blog.isquaredsoftware.com/2019/11/blogged-answers-le...




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

Search: