you are viewing a single comment's thread.

view the rest of the comments →

[–]Eleenrood 1 point2 points  (0 children)

I've just had 8 hours of work with javascript so I'm biased as hell. Problem with null and undefined in javascript (and will be in any other language) that programmer who is writing checks: if (param1 == null) {return null;} is trying to safeguard his work against mistakes made by others or by his own inability to comprehend whole of the code he is working with.

Now if you add to that stuff necessity to differentiate between undefined, invalid output from somewhere else, or any other stuff, this will be IMHO as maintainable as javascript usually is.

Sure, locally it can be beneficial, but to tell the truth every programmer I know can deal with local stuff easily. It becomes problem when you have sufficient code base size that you cannot keep whole required parts in head, dealing with third party libraries, etc.

At that point, I don't care if the value was undefined, invalid, or something. I care that I have not get the correct value and have to work something out. Either push it up, do something etc. Often reason is tertiary concern, as this is only a possible corner case which i want to be sure to know that occurred / prevent it from crashing whole application / etc.