4 ms·
My point is I never use null or worry about "strict null checking" or even what that is in the first place or even how it is configured.
by orange8 6y ago
My point is I never use null or worry about "strict null checking" or even what that is in the first place or even how it is configured.
- Vinnl 6y agoWell, good for you, bit you can run into the exact same problems with undefined (which you do use), and TypeScript still helps with those in the exact same way. Which is to say: whether you use null or undefined is not really relevant to the point that was being made...
- orange8 6y agoThank you. I use undefined very rarely, usually with a hacky looking: "typeof foo === 'undefined'". I'd still rather just type that though than having to setup up TS. Don't get me wrong, TS is great for the eco-system, for examples it powers the intellisense behind vscode which I use daily. I just do not need to use it directly, so good for me indeed.
- spion 6y agoNext time you get a "Cannot read property <x> of undefined" error at runtime, take a moment to trace why it happened, then read https://shinesolutions.com/2017/01/06/writing-safer-code-with-typescript-strict-null-checks-type-guards/ https://shinesolutions.com/2017/01/06/writing-safer-code-wit...