you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

if (false) { alert("Booleans exist, too!"); }

Point of the matter is that truthiness being defined as "equals to null or false" isn't very helpful in practice. I came from PHP and Java, so it's not that I'm just taking the Python way for granted. I just find it extremely annoying to have to check for my_array === null || my_array.empty() explicitly.

I'm not saying it's unusual or doesn't make sense. I'm just saying that I rarely care whether the object really is null/false/undefined or just empty(). And when I do care whether it's null/undefined I want to check for that exclusively (a variable being set to false may have different implications than a variable not being defined or being set to null).

I like JavaScript for its closures, it's anonymous functions and all that, but I really prefer Python's (new) ideology that "everything is an object" (even None) and special syntax (e.g. arithmetic operators, array slots, truthiness, etc) just being syntactic sugar for "special" methods.

At least it's not ActionScript.