How do you structure your if statements, and what do you consider the easier-to-read of the two? As in:
if(condition){
//...
}
compared to
if(condition)
{
//...
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I use the first method. It is easier to read, and in some cases, you may omit the {} (if one line is following the if statement).
Visual Studio can be set to do this automatically, and I’m sure other platforms can be set to format the code as well.