Last active
August 29, 2015 14:08
-
-
Save polarity/75e904d9527744bc83f4 to your computer and use it in GitHub Desktop.
Sometimes you have to secure a method with a condition. But you also get one more indentation space. Is it okay to use something like in the second case? less secure or safe maybe? just asking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Whats Better? | |
// more indentation | |
function myFunction(data){ | |
if(data){ | |
// do some important stuff | |
data.parse() | |
} | |
} | |
// or (lee identation) | |
function myFunction(data){ | |
if(!data){ return false; } | |
// do some important stuff | |
data.parse(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment