-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Should they be removed?
Currently i check defined in some functions, and in some other i don't. I do that to usually avoid defined values. But constant checking creates some performance overhead. Overhead that also is usually not needed everywhere because in creation of an Array i usually do some checking to avoid those values. Function that create an Array usually use defined to abort the creation
of an Array.
In some other functions so far it seems sometimes i do defined checking to abort or either skip values. And in some others
i don't do anything about them.
This has to be consistent:
undefaborts creation when creating an array.undefusually aborts iterating an array when it appears.
Otherwise i could do just do nithing with them and consider it a programming bug/error when a programmer has undef
in arrays, not a problem with Sq.
A reason for removing those checks are that they create a constant performance hit for every element that is processed in
an array. This check makes things slower and this performance hit is also what you get with Arrays containing no undef at all.
While I like some defensive programming that helps in writing good code i am not a big fan of being too much defensive, especially not when performance has to suffer for it.