Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualShaquil

Posted 17 April 2013 - 07:28 AM

in-fact i wouldn't mind if C++ ditched the braces completely in the next version of the standard and switched to using indentation to set the scope)

 

Easy there, trigger.

 

EDIT:

 

By the way, I've never asked anyone this because I've rarely had anyone else read my code, but I wonder if this habit I have is a case of "overcommenting." Basically, I keep the opening brace on the same line, and I always comment the closing brace, even if it's really really obvious. It helps me with re-reading my code, but I do sometimes wonder if another programmer might think I'm overdoing it haha. For example:

 

void myFunction(){
  if(/*condition*/){
    doSomething(x, y);
    doSomethingElse(a, b);
    switch(/*condition*/){
       case blah:
           break;
    }//end of switch
  }//end of if
}//end of myFunction()

#2Shaquil

Posted 17 April 2013 - 07:27 AM

in-fact i wouldn't mind if C++ ditched the braces completely in the next version of the standard and switched to using indentation to set the scope)

 

Easy there, trigger.

 

EDIT:

 

By the way, I've never asked anyone this because I've rarely had anyone else read my code, but I wonder if this habit I have is a case of "overcommenting." Basically, I keep the opening brace on the same line, and I always comment the closing brace, even if it's really really obvious. It helps me with re-reading my code, but I do sometimes wonder if another programmer might think I'm overdoing it haha. For example:

 

void myFunction(){
  if(//condition){
    doSomething(x, y);
    doSomethingElse(a, b);
    switch(//condition){
       case blah:
           break;
    }//end of switch
  }//end of if
}//end of myFunction()

#1Shaquil

Posted 17 April 2013 - 07:19 AM

in-fact i wouldn't mind if C++ ditched the braces completely in the next version of the standard and switched to using indentation to set the scope)

 

Easy there, trigger.


PARTNERS