Re:All I Want for Christmas Is These Seven TypeScript Improv...
by andreareina on Sunday December 25, 2022 @11:24PM
(#34134569)
Pure being the default would lead to most functions being written to be pure. Same idea as immutability by default.
[ Parent
| on HN ]
Re:All I Want for Christmas Is These Seven TypeScript Improv...
by jonas21 on Monday December 26, 2022 @01:07AM
(#34135111)
One of the best things about TypeScript is that you can adopt it incrementally, i.e. valid Javascript is also valid TypeScript. For that to work, you have to assume functions are impure by default.
Re:All I Want for Christmas Is These Seven TypeScript Improv...
by goto11 on Friday December 30, 2022 @07:48AM
(#34184519)
> Pure being the default would lead to most functions being written to be pure.
More likely it would lead to most functions looking like they are pure, whether they are actually pure or not.