News for hackers. Stuff that matters.
Re:First look: adding type annotations to JavaScript by forrest2 on Thursday March 10, 2022 @03:06PM (#30631748)
> find that ts normally brings a downside, actually. In one project I maintain, a solid 30% of the code is nothing but ts stuff.

That 30% number is almost certainly why. The experience with codebases with 100% type coverage / tight types have been glorious, and the ones with partial coverage / plain js files / lots of "as any" / lack of strict compiler flags https://www.typescriptlang.org/docs/handbook/compiler-option... have been miserable and a waste of time. Can't stress the strict flags enough.

One of the "pros" of typescript is its gradual typing, but I think it's a trap and forces poor impressions on people.

One of those reasons is how `any` works. In gradual adoption, lots of stuff turns into `any`. `any` is a contagious/viral construct where anything it touches could become `any`. And then you spiral out of control and the whole codebase gets nothing from typescript but gets all the operational overhead.

If your browser doesn't support text fragments, can cmd/ctrl+f for "contagious" and/or "gradual" https://www.typescriptlang.org/docs/handbook/typescript-in-5...

Re:First look: adding type annotations to JavaScript by claytongulick on Thursday March 10, 2022 @10:21PM (#30635743)
I'm specifically referring to an extra 30% of LOC that does nothing other than type abstraction and provides no functional value.

30% is a conservative number.

Re:First look: adding type annotations to JavaScript by forrest2 on Thursday March 10, 2022 @11:10PM (#30636069)
Ah sorry, I misread your claim.

Sounds high but if it's true it's true.