First code:
if(i==0) {// do instructions here}
Second code:
if(0==i) { // do instructions here }
What
In C# there is no difference. However in C++ there was a difference in performance which is why you see both used in C# code these days - actually I'm thinking of i++ vs ++i about performance - 0 == i is a common coding recommendation in C/C++ to avoid i = 0 as an accidental operation
When you write (0==i) the error of using single equal to sign by mistake (e.g. ) if ( i = 0) is eliminated. Nothing else.