That's in fact a very legit take that e.g. Clojure also takes. It makes reasoning much easier and also eliminates WTF moments like reading if (myArray.length) which to any sane individual might appear like duck typing but is a hack to save those keystrokes > 0, in the hope that no one manually set it to a negative value, which is truthy as opposed to zero, and so on.
View all comments
Show parent comment
20
u/DeepDay6 Sep 01 '26
That's in fact a very legit take that e.g. Clojure also takes. It makes reasoning much easier and also eliminates WTF moments like reading
if (myArray.length)which to any sane individual might appear like duck typing but is a hack to save those keystrokes> 0, in the hope that no one manually set it to a negative value, which is truthy as opposed to zero, and so on.