3 ms·
Ask HN: API Method Naming Clarity
We are designing API and arguing with developers to death about clarity.
Let's say you have a service that allow to add entities to collections. For example, you can add Task to Feature. What name is better?
1. addToCollection(type, id, collectionField, collectionEntityId)
2. addCollectionItem(type, field, id, itemId)
- jerome-jh 7y agoLacking many details here, but assuming this is C (or another function centric language), I would favor: <collection>_<action>_<item>() So with "feature" and "task": feature_add_task()