When should I use optional parenthesis?

The exercise mentions we can add optional parentheses to the conditions to make it clearer for other developers. What is considered best practice? Is it recommended to use the optional parentheses or not? Thanks for the help!

Brackets are for grouping, and if grouping is not required for operator precedence, we don’t need them. Code is just as readable without them, assuming the reader understands order of operations.

Thank you! That is really helpful!

1 Like