Clarity : Convention « Language « C Tutorial






/* poor programming practice */    

    temp = box_x1; 

    box_x1 = box_x2;   

    box_x2 = temp; 

    temp = box_y1; 

    box_y1 = box_y2;   

    box_y2 = temp;

A better version would be:

/* 

    * Swap the two corners     

    */ 
      

    /* Swap X coordinate */    

    temp = box_x1; 
    box_x1 = box_x2;   
    box_x2 = temp; 

    /* Swap Y coordinate */    
    temp = box_y1; 
    box_y1 = box_y2;   
    box_y2 = temp;








1.16.Convention
1.16.1.Indentation and Code Format
1.16.2.Clarity