@[email protected] to [email protected] • 8 months agoSelf-documenting Codelackofimagination.orgexternal-linkmessage-square72fedilinkarrow-up1100
arrow-up1100external-linkSelf-documenting Codelackofimagination.org@[email protected] to [email protected] • 8 months agomessage-square72fedilink
minus-square@[email protected]linkfedilinkEnglish48•8 months agoAgreed. OP was doing well until they replaced the if statements with ‚function call || throw error’. That’s still an if statement, but obfuscated.
minus-square@[email protected]linkfedilink7•8 months agoDon’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”.
minus-square@[email protected]linkfedilink3•8 months agoShort 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.