Comment

Comment by nly

Am I the only one who would expect the behavior in the top example?

I don't want my equality operator doing timezone conversions. If one type has no timezone attached and one does, then you probably shouldn't be able to compare them at all. Likewise, for a type that has a timezone attached, if the timezone differs between a and b, then I want a == b to return false, even if it represents the same instant in time.

Equality can be a tricky thing. Named functions are the way to go when two different developers might intuit different behaviors.

parent nly 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton