I basically learnt C/C++ programming by myself, so I don't know much about good programming habit. One thing always make me wonder is why people always like to add spacing between operators in their codes like:
if(x > 0)
instead of
if(x>0)
Are there any particular reasons for that? We know the compiler simply ignores such spacings, and I don't think the latter expression is less readable.
>
(but not around very tightly binding operators like.
and->
and[]
). – Turfyif
and the parenthesized controlling expression:if (x > 0)
. – Tanika