coding standards
Each developer has its own view on coding standards. What about you ?
Do you prefer this syntax :
int arrayIndex = 1 ;
boolean isOk = true ;
if (isOk)
{
doSomething() ;
}
else if (1 == arrayIndex)
{
doSomethingElse() ;
}
public static boolean contains (int[] anArray, int aValue)
{
for (int i = anArray.length - 1; i >= 0; i--)
{
if (anArray [i] == aValue)
{
return true ;
}
}
return false ;
}
or this one :
int arrayIndex = 1;
boolean isOk;
isOk=true;
if (isOk == true) {
doSomething();
} else if (arrayIndex==1) {
doSomethingElse();
}
public
static
boolean
contains (int[] anArray, int aValue) {
boolean found;
for (int i = anArray.length-1; i>=0; i--) {
if (aValue==anArray[i]) {
found=true;
break;
}
return found;
}
I’ve been using the former for a long time now (on JAVA and C/C++) and I couldn’t change my habits so easily.