Quote:
Originally posted by Epsilon
I recently finished up a Web application for a client that was just under 7000 lines of code. Out of curiosity, I wrote a little script to count the number of times I could have gotten away with leaving the braces off a statement.
The total "space" savings would amount to less than a kilobyte. So I guess if I was really anal about the size of my script I could reduce it from 269K to 268K.
Nah, I think I'll leave the braces in.
JJoSA made a good point that it can make debugging a nightmare.
|
no no, the trick is to reduce all your "if" statements so that they can fit in one statement
Code:
if(a){
doThis();
doThat();
doSomething();
}
// becomes:
if(a)
doThis();
if(a)
doThat();
if(a)
doSomething();
seriously tho, i use the no-bracket if statement all the time. I just wish I could write methods that way
