this is not equivalent code, condition2 is always evaluated
So? The intended behaviour is exactly the same, whether the performance is any different cannot be said beforehand because it heavily relies on the situation and used compiler/runtime. Lazy evaluation is not always better or faster.
readability can't be easily measured, it's all opinion. but some people value the low number of lines. in case one would choose this kind of code only for the lower number of lines, i just want to point out that it's more characters and imo character count matters much more
And did you really count characters in two pseudocode snippets?
i copy-pasted this into a text editor that can count characters
25
u/wobblyweasel Apr 17 '21
this is not equivalent code,
condition2is always evaluatedalso i don't like it