{"id":423,"date":"2004-06-03T21:52:00","date_gmt":"2004-06-03T21:52:00","guid":{"rendered":"http:\/\/www.dresan.com\/blog\/?p=423"},"modified":"2004-06-03T21:52:00","modified_gmt":"2004-06-03T21:52:00","slug":"why-isnt-there-a-naming-convention-for-apis","status":"publish","type":"post","link":"https:\/\/dresan.com\/blog\/2004\/06\/03\/why-isnt-there-a-naming-convention-for-apis\/","title":{"rendered":"Why isn&#8217;t there a naming convention for APIs?"},"content":{"rendered":"<p>I was working on an API and had trouble picking a name for<br \/>a particular operation (which we&#8217;ll call, say, &#8220;getCurrentText&#8221;<br \/>for sake of argument). TheFullyExplicitName was a little long<br \/>and unwieldy and I hve vry strng f3l&#8217;ns agst Un*x stle abbrs, <br \/>so I wanted to derive a simple text name that fits with the<br \/>rest of the API (read, readLine, isMoreNeeded).<\/p>\n<p>So I ferret around on the web and find a few interesting<br \/>resources:<\/p>\n<p><a href=\"http:\/\/java.sun.com\/j2se\/1.4.2\/docs\/guide\/collections\/designfaq.html\">Java Collections API Design FAQ<\/a><\/p>\n<p><a href=\"http:\/\/www.artima.com\/apidesign\/\">API Design with Java<\/a><\/p>\n<p>but no good resource for overall API names.<\/p>\n<p>It seems to me there should be a standard lexicon of API<br \/>names.  Just as there are standards for names in given languages<br \/>(e.g., getX\/setX in Java, get\/set properties in C#, -p predicates<br \/>in Lisp, isX for predicates in Java-like languages, etc.) there should<br \/>be standard names we can use for APIs with standard definitions<\/p>\n<p>read\/write or read\/print<\/p>\n<p>open\/close<\/p>\n<p>clear<\/p>\n<p>iterator\/hasNext\/next<\/p>\n<p>and so on.  I guess there need to be two parts to this library:<br \/>the semantic list of terms that are common to many APIs, and<br \/>standard names that have maximum usage across the API&#8217;s<br \/>semantic contents.<\/p>\n<p>Anyway, just rambling.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was working on an API and had trouble picking a name fora particular operation (which we&#8217;ll call, say, &#8220;getCurrentText&#8221;for sake of argument). TheFullyExplicitName was a little longand unwieldy and&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11],"class_list":["post-423","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-development","ratio-2-1","entry"],"_links":{"self":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/comments?post=423"}],"version-history":[{"count":0,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/posts\/423\/revisions"}],"wp:attachment":[{"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/media?parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/categories?post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dresan.com\/blog\/wp-json\/wp\/v2\/tags?post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}