3 ms·
I wouldn’t recommend that. You want your types to have meaning for the business and you want to derive types from each other. It’s counterproductive to individu
by idontwantthis 3y ago
I wouldn’t recommend that. You want your types to have meaning for the business and you want to derive types from each other. It’s counterproductive to individually type every variable without context.
- rocqua 3y agoIn python at least, with strict-mode, Any is useless because you can do almost nothing to it. You can print, you can call 'dir' 'help' and other built-ins, and you can pass it to functions that accept Any. That means that sprinkling any around your code isn't a great way to silence errors.
- idontwantthis 3y agoI don’t know about Python, but for converting JS to TS you start with allow-implicit-any turned on and add types to your business objects as you go. Eventually your turn it off and fix what remains.
- chriskrycho 3y agoNote that while a lot of people do it this way, my blog post this discussion is notionally about on expressly argues that that’s exactly what not to do!
- idontwantthis 3y agoI have now, in fact, RTFA! You definitely make a lot of good points.