JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Code Syntax Style: Optional Parentheses

Last modified: 11 February 2024

In many cases, parentheses in expressions are optional. Sometimes they help you clarify precedence of operations — for example if ((a & b) | c), sometimes, however, they do not help at all and just add up to dead code — var d = a + (b + c);. JetBrains Rider will help you define where optional parentheses are helpful to you, and then either clean up the redundant parenthesis or automatically add missing ones where necessary.

JetBrains Rider helps you arrange optional parentheses in the existing code and takes your preferences into account when it produces new code with code completion and code generation features, applies code templates and performs refactorings.