News for hackers. Stuff that matters.
Re:Deno Is Webby by recursive on Wednesday March 16, 2022 @06:15PM (#30704817)
In that case "" should be truthy. And 0 should be truthy too probably.
Re:Deno Is Webby by adam_arthur on Wednesday March 16, 2022 @06:57PM (#30705227)
They should be, to have consistency in design. Note that if the language operated this way, checks on these types would be more explicit (though more verbose too).

Checking for presence of a number with a truthy check is a common source of errors, if 0 is a valid number.

I just don't agree at all that Python's interpretation of truthiness (or equality, for that matter) is inherently the "right" one. If I clone somebody are they equal because they have the same genetic makeup? No. Though a pretty contrived example that requires common understanding of equality.

At least from a programming perspective, I usually care more about instance equality rather than structural equality. Of course Python supports that too via the `is` keyword

Re:Deno Is Webby by ckolkey on Wednesday March 16, 2022 @06:23PM (#30704889)
Yes and yes. Ruby got it right, no question :)