re: Towards zero bugs VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Thanks for your very insightful comment! Software, by default, grows complex and chaotic as it develops and evolves. Like a living organism, I thi...
 

Hewwo, pwease change

- if (hidden) { show(); } else { hide(); }
+ if (hidden) { hide(); } else { show(); }`.

if hidden is the current state.
OR, if hidden is desired state, change

- if (!hidden) { show(); } else { hide(); }
+ if (!hidden) { hide(); } else { show(); }

You didn't flip the cases when negating the predicate.

Stylistically I would ofc prefer one of:

if (hidden) show()
else hide()

or

hidden ? show() : hide()

for a better signal/noise ratio (which makes bugs more evident)

code of conduct - report abuse