Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Anti-If: The missing patterns (2016). Parent comment
a -> isAdmin
b -> isActive
const isDeletableUser = !isAdmin && isActive; return isDeletableUser;
Point is for me that booleans with readable names shows how eliminating ifs becomes not only doable but arguably preferable.
There are no comments on this comment yet.
a -> isAdmin
b -> isActive
(Better would be naming the function "isDeletableUser" instead of the intermediate const, but was keeping with the original.)Point is for me that booleans with readable names shows how eliminating ifs becomes not only doable but arguably preferable.