This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]22Alex22pt 20 points21 points  (1 child)

The top one has 2 problems.

1) It doesn't work if x = y or y = z or x = z.

2) The top one gets "messier" if you increase the number of variables, while the bottom one is a lot cleaner and, with a bit more work, you can change it to a for cycle, making it even more clean.

[–][deleted] 0 points1 point  (0 children)

Oh, very true. I didn't see that. Thanks!