Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This is interesting!
Speaking of readability, I suppose that in case like that (one arm is much longer than the other one) early return on
v1 >= v2
would actually make code easier to read because it would make logic more clear and also remove two levels of nesting.I prefer match for readability and because it scales better for more cases so my default style is to use it. I agree that, for this case, 'if' would be fine.
But why not just
if
?