Grumpy old fart that throws up a little every time he sees someone being passionate about some javascript lib. Tech agnostic. If it bleeds, I can kill -9 it.
It is not necessarily about nulls, but what to do in the absence of a value. You can often find multiple types of these null classes to cover different cases. And it does mean you have to rearchitect anything. For instance, when designing a Card component in a React application, that was dealt a User object, we assumed it would always exist. Suddenly, it was potentially optional, but that would imply changing user: User to user: User | undefined through multiple levels. Simply creating a NullUser that was returned at the top level selector function allowed us to make 0 (zero) changes further down.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It is not necessarily about
null
s, but what to do in the absence of a value. You can often find multiple types of these null classes to cover different cases. And it does mean you have to rearchitect anything. For instance, when designing a Card component in a React application, that was dealt aUser
object, we assumed it would always exist. Suddenly, it was potentially optional, but that would imply changinguser: User
touser: User | undefined
through multiple levels. Simply creating aNullUser
that was returned at the top level selector function allowed us to make 0 (zero) changes further down.