-
-
Notifications
You must be signed in to change notification settings - Fork 659
Description
Currently, there is some noticeable friction with introducing vavr in an existing codebase due to naming conflicts with the standard library for common collections such as List, Map, etc. In my experience, this has been one of the main reasons for pushback when trying to integrate vavr in an existing codebase, and I do agree that it causes issues with:
- Making it harder to migrate bit-by-bit by requiring that the entire file is migrated at once, or that the file is split in non-vavr and vavr halves during the transition.
- Making it somewhat confusing for newcomers that expect
List,Map, etc. to refer to the standard versions instead of the vavr ones. This is even more so if different files use different versions, or if one file mixes vavr and non-vavr collections. - Making it more difficult to ensure consistency in code review. While the two sets of collections looks different when used in more complex cases, they look pretty similar in usage for simple cases. Hence, extra care is required to double check which one is being used during code review.
In my experience, the above makes adoption harder than it needs to be, since people are hesitant to deal with the confusion/inconsistency in an existing code base. In the case of a new project, everyone needs to be on board to essentially replace the standard library with vavr and be vigilant about not mixing them.
I made this issue to have a discussion about easing this friction. In particular, the people that I have talked to feel that it would be a lot easier/less surprising/less error prone if the vavr variants had a slightly different name, and I tend to agree. For example, if the collections were called VList, VSet, VFuture, etc. it would be clear which one was being used. For values like Option, Either, Try, etc. that already have different names, this is not an issue, but it might be worth using the same naming convention throughout.