2024-04-02 22:59:51

Coding thoughts:

The combination of optional/nullable types and optional chaining gives you so much temptation to write bad code.

It’s become so easy to just add a little ? here and a “| null” there to quickly fix some error you saw.

But it’s a trap!!

Once you start they breed like crazy through your codebase.

It’s weird for me to see:

x = a?.b?.c

Because if you have an a then you should know that you have a b and a c! (I know this is not the case with TypeScript)