Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    This is a matter of opinion. In my opinion, I'd always select the first option as the intent of the code is clearer: check length of the arrays, then check the lengths of the elements. But that is just opinion: there's no right answer to this. Commented Sep 21, 2018 at 8:43
  • 3
    If the specification is "if the array lengths are unequal the answer is always FALSE", then checking boundaries over and over within the loop would be both wasteful and less readable. I see no upside to Style 2. Commented Sep 21, 2018 at 10:28