News for hackers. Stuff that matters.
Re:Push ifs up and fors down by collingreen on Wednesday November 15, 2023 @06:22PM (#38283858)
I don't agree it is unhelpful commentary. I think it makes an important point that just following some rules you found won't be enough because the right answer isn't a result of something arbitrary/universal but is a side effect of a better understanding of the responsibility of each piece of code you're writing.
Re:Push ifs up and fors down by Aeolun on Wednesday November 15, 2023 @08:36PM (#38284897)
I think you’ll have better code on average if you always apply these rules than if you don’t.

It’s not always helpful to give people the option to do it as they think is best.

Re:Push ifs up and fors down by zeven7 on Wednesday November 15, 2023 @09:20PM (#38285177)
> than if you don’t

If by “don’t” you mean “do the opposite” then I agree. The third option is “don’t follow the rule blindly but think about the situation”, and for that case it depends entirely on the person and how well they think.

Re:Push ifs up and fors down by darkerside on Wednesday November 15, 2023 @09:39PM (#38285317)
I do think it is shortsighted, and equally helpful and harmful. Helpful in that it reminds the reader this is only one of many considerations that should be taken into account. Harmful because it borders on implying that this shouldn't even be a consideration taken into account because it is irrelevant.