-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
In my opinion, names such as Binary, List, Text are too generic and prone to naming collisions. It might not be much of a problem within this project, as a low level library, it isn't unreasonable high level applications might already be using List, Text, etc. Two main problems arise frequently when there are two Text types such as Bencodex.Types.Text and some App.Text:
- It isn't immediately apparent which
Texttype is being used at a glance. Yes, in most cases, it can be derived from context and IDEs help, but this still is unnecessarily confusing. - Again, it is also often likely to happen both
Texttypes are needed in a single source file since the whole point ofBencodex.Types.Textis to encodestringorApp.Text, in which case either unnecessary aliasing or fully qualified names are needed.
Honestly, I think it'd be better to name such types as BList, BText, etc. like here. There are pros and cons but I'd say overall the benefits outweigh the costs. As we have no control over the naming scheme in end-user's codebase, we should do as much as possible to avoid name collisions happening in the first place.
Metadata
Metadata
Assignees
Labels
No labels