
Ask HN: API Method Naming Clarity - tablet
We are designing API and arguing with developers to death about clarity.<p>Let&#x27;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?<p>1. addToCollection(type, id, collectionField, collectionEntityId)<p>2. addCollectionItem(type, field, id, itemId)
======
jerome-jh
Lacking 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()

