What is the term that means "keeping the arguments for different API calls as similar as possible"?
Posted
by
larson4
on Programmers
See other posts from Programmers
or by larson4
Published on 2011-03-11T00:13:57Z
Indexed on
2011/03/11
0:18 UTC
Read the original article
Hit count: 256
There is a word which I can never remember... it expresses a design goal that API calls (or functions or methods or whatever) should be as similar as reasonably possible in their argument patterns. It may also extend to naming as well. In other words, all other things being equal, it is probably bad to have these three functions:
deleteUser(email)
petRemove(petId,species)
destroyPlanet(planetName,starName)
if instead you could have
deleteUser(userId)
deletePet(petId)
deletePlanet(planetId)
What is the word for this concept? I keep thinking it's "orthogonal" but it definitely isn't.
Its a very important concept, and to me it's one of the biggest things that makes some APIs a joy to work with (because once you learn a few things you can pretty much use everything without looking at doco), and others a pain (because every function is done inconsistently).
© Programmers or respective owner