vendredi 28 avril 2017

Why use : instead of { in if statements

Why do people use

if(condition) :
    /*do something*/
else:
    /*do something else*/
endif;

instead of

if(condition) 
{
    /*do something*/
} 
else
{
    /*do something else*/
}

Is one better than the other in any way? What should i get use to too?

Aucun commentaire:

Enregistrer un commentaire