3 ms·
As I understand it, there is a 'production mode' that disables the runtime type checking. This way developers can gain the development-time benefits of type sa
by zackbrown 12y ago
As I understand it, there is a 'production mode' that disables the runtime type checking. This way developers can gain the development-time benefits of type safety without sacrificing performance where it counts.
As for the benefits of duck typing, also as I understand it, the key point of runtime vs static checking is that it eases interoperation with non-annotated and non-typed code. So duck-type if and when you want; reap the benefits of types when you want.
For a much better explanation, watch Misko Hevery's keynote about Angular 2 and AtScript from NgEurope yesterday: http://youtu.be/S8fE-w2DL8U?t=21m5s http://youtu.be/S8fE-w2DL8U?t=21m5s
- malandrew 12y agoYup. Plus it should also be possible to only turn on type checking selectively for some functions in production. This way to you can implement it on functions that are executed infrequently and don't have a material impact on performance, but leave it off for those code paths that are critical for performance.