Self-documenting CodeAijan@programming.dev to Programming@programming.dev – 84 points – 3 weeks agolackofimagination.org72Post a CommentPreviewYou are viewing a single commentView all commentsShow the parent commentAgreed. OP was doing well until they replaced the if statements with ‚function call || throw error’. That’s still an if statement, but obfuscated.Don't mind the || but I do agree if you're validating an input you'd best find all issues at once instead of "first rule wins".Short circuiting conditions is important. Mainly for things such as: if(Object != Null && Object.HasThing) ... Without short circuit evaluation you end up with a null pointer exception.
Agreed. OP was doing well until they replaced the if statements with ‚function call || throw error’. That’s still an if statement, but obfuscated.Don't mind the || but I do agree if you're validating an input you'd best find all issues at once instead of "first rule wins".Short circuiting conditions is important. Mainly for things such as: if(Object != Null && Object.HasThing) ... Without short circuit evaluation you end up with a null pointer exception.
Don't mind the || but I do agree if you're validating an input you'd best find all issues at once instead of "first rule wins".Short circuiting conditions is important. Mainly for things such as: if(Object != Null && Object.HasThing) ... Without short circuit evaluation you end up with a null pointer exception.
Short circuiting conditions is important. Mainly for things such as: if(Object != Null && Object.HasThing) ... Without short circuit evaluation you end up with a null pointer exception.
Agreed. OP was doing well until they replaced the if statements with ‚function call || throw error’. That’s still an if statement, but obfuscated.
Don't mind the
||
but I do agree if you're validating an input you'd best find all issues at once instead of "first rule wins".Short circuiting conditions is important. Mainly for things such as:
Without short circuit evaluation you end up with a null pointer exception.