Y
Hacker News
new
|
ask
|
show
|
jobs
by
craftit
903 days ago
It saves writing lots of boilerplate. If you implement it for a type, you automatically get: <, >, <=, >=, ==, !=
1 comments
mysterydip
903 days ago
Ah that makes sense, thanks! Then you can just do normal comparisons on the integer value of < > or == to 0.
link
wkennington
902 days ago
It also makes implementing all those operators easier for similar objects as you don’t need to plumb 6 different routines.
link