Skip to content

Conversation

@maybeanerd
Copy link

When looking into the implementation to understand behavior, it's very confusing to invert the ordering in relation to how the mental model works. This aligns implementation and mental model of the sort of versions in the end.

The part that was most confusing in my experience is that the docs vaguely mention "latest" and "last" element, but when looking at the implenetation, it seems we take the first element of the array - this is very unintuitive, and only makes sense after understanding that the implementation internally sorts exactly the other way around. This change should have no real impact on performance, but should make the code much more readable in my opinion. Tests are unchanged, because behavior is unchanged.

When looking into the implementation to understand behavior, it's very confusing to invert the ordering in relation to how te mental model works. This aligns implementation and mental model of the sort of versions in the end

Signed-off-by: Sebastian Di Luzio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant