BTSJimin's blog

By BTSJimin, history, 8 hours ago, In English

Sometimes, I use too much '(',')' because of this anxiety:

if( ( ((a+5)/2)  + (c*2))  == ((((b^1)&1) * 2) + 3) ){
    blabla;
}

How to solve this issue?

  • Vote: I like it
  • +19
  • Vote: I do not like it

»
8 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

lmao same (╥﹏╥)

»
8 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Me too lol

»
7 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

I just use them with bitwise operations

»
7 hours ago, # |
  Vote: I like it +31 Vote: I do not like it

You needn't (and, shouldn't) solve this issue.

You needn't to spend a lot of time debugging on a few brackets.

»
6 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone explain it for me?

»
4 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

same. Also this happens in math when im writing equations lol.

»
2 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

If you are on Linux, use man operator for your quick reference (online manual of operator(7)).

Generally, I think it's fine to use parentheses for bitwise and logical operators. Precedence of arithmetic operators is easy to remember.