The use of parenthesis in source code is to do with so-called operator precedence or just with readability of the code.
Some operators in a given programming language have more weight as so to speak in comparison to other operators.
We need to have a way to explicitly tell in which kind of order our operators are executed. For this we can use parenthesis (doesn't have to be parenthesis, but in most programming languages parenthesis are used).
I will give a short example.
These two calculations give a different result:
a + b / c
(a + b) / c
In the first example what happens is that first b gets divided by c, and then the result of that computation is added together with a.
In the second example what happens is that first a and b are added together, and then the result of that computation is divided by c.
It is like that because the / operator has a higher precedence than the + operator.
These are simple examples but this thing called operator precedence really goes through the whole programming language, and you have to be aware of it when writing source code in any given programming language.
It is best to write the parenthesis if there is even a small possibility that someone will understand the statement wrong. So writing the parenthesis even when they are not technically needed is a readability help to help people understand the code correctly.
Let's take our example further. If our intent was really to first divide b with c and then add the result to a, we could write either
a + b / c
or
a + ( b / c )
and both would give us the correct result, as they are both technically correct. But for clarity of the code we should use the latter style, with the parenthesis, to make it clear for everyone reading the source code what exactly will happen on that line.
What the writer of the code in the first post of this thread probably wanted was to make sure that the code works (maybe wasn't sure if it does or not without the parenthesis so played it safe) or that it is easier to understand the code. The latter choice is more likely I think. It just makes it clearer code to read. If you would have more than one condition on the same line, then things get trickier and you should use the parenthesis also for ensuring the correct order of operations.