I wish to use this sample to make my code more readable. Could you share with me your ideas on method naming, variable naming, if
-statements etc.
It would be great if you have any URL
s.
private boolean areEngineersHappy (List<Engineer> engineers) {
int notHappyEngineers = 0;
int happyEngineers = 0;
for (Engineer engineer : engineers) {
boolean notHappy = !engineer.isHappy();
if (!notHappy) {
happyEngineers++;
}
if (notHappy) {
notHappyEngineers++;
}
}
return happyEngineers > notHappyEngineers;
}
true
within Java, except the engineers were unhappy with this and refused to put it in. \$\endgroup\$