logoalt Hacker News

zemtoday at 7:54 AM2 repliesview on HN

why, though? the current version is the interesting property


Replies

Cthulhu_today at 11:21 AM

There's a rule of thumb somewhere that booleans should always be named / represent something positive, so "enabled" instead of "disabled", "visible" instead of "hidden", and "has_been_viewed_much" instead of "has_not_been_viewed_much".

see e.g. https://codehealth.dev/prefer-positive-booleans/

ramon156today at 8:14 AM

They meant that a more ergonomic name would be "has_been_viewed_much", so you can filter by the inverse and still get the same result, but with a better name

show 1 reply