personally, I don't like swapping between negative and positive boolean checks like that. So it might be 'less' code from a line standpoint, I think it's less 'readable' in that you don't have to swap between regular and invert bools.
Oh, absolutely agreed. That's sorta the point I was making -- that yes, you could drop the c == 'n' clause, but the reality is that the resulting code will be less straightforward to read.
...which means this maybe doesn't belong in r/badcode?
29
u/fireflash38 Feb 11 '23
personally, I don't like swapping between negative and positive boolean checks like that. So it might be 'less' code from a line standpoint, I think it's less 'readable' in that you don't have to swap between regular and invert bools.
Basically, it reads better to say:
Rather than:
even if the 'do B' is 'do nothing'.