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.
"instead of making guards using null, you propose to create useless empty array and objects"
No. Instead of making 10 null checks, you do 1.This pattern never makes sense if you just want to avoid a single null check. But when you do the same checking at multiple levels, this vastly simplifies logic at times.
I have great experience in IT over 12 years: front / back - ends, mobile, system administration and deployment cycle. I implement effective and great software products.
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.
Immutable code where you can drop all null checking is fantastic to work with. And I have been using the Null object (/DefaultObject pattern) for a decade in various settings. Still does wonders for avoiding nasty NPEs in Java and works quite well in JS as well, though I am pragmatic: I do not create a full 1:1 mapping for every class. Just the ones where it makes sense.
I have great experience in IT over 12 years: front / back - ends, mobile, system administration and deployment cycle. I implement effective and great software products.
Hi, the talk in my comments is not about mutability , but about clean and not overused code with default values where execution must be terminated, but not being executed with empty values.
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.
What?
No. Instead of making 10 null checks, you do 1.This pattern never makes sense if you just want to avoid a single null check. But when you do the same checking at multiple levels, this vastly simplifies logic at times.
Review your comment in 10 years.
Immutable code where you can drop all null checking is fantastic to work with. And I have been using the Null object (/DefaultObject pattern) for a decade in various settings. Still does wonders for avoiding nasty NPEs in Java and works quite well in JS as well, though I am pragmatic: I do not create a full 1:1 mapping for every class. Just the ones where it makes sense.
Hi, the talk in my comments is not about mutability , but about clean and not overused code with default values where execution must be terminated, but not being executed with empty values.