As I was reading a colleague\'s Java code, I stumbled upon an army of if/else statements. In these statements, several &&
and ||
operators wer
I see what you were trying to do, but before operating on parentheses it's good to have the language's specification handy. I've known a few programmers who have gone so far as to keep the important bits, like operator precedence, on their walls.
The second part is to know whether your alterations are going to make any sense to the other people in your workplace; if removing parentheses compromises the meaning of an operation to someone else working on the code, then it could ultimately be detrimental.
The optimizer will generally take care of it for you, so when in doubt, leave them in there.