|
Authored by: mschmitz on Friday, May 04 2012 @ 07:58 PM EDT |
As a programmer, you know that FOO can do anything you want :-)
Since Rich did not specify a return type, you are even free to chose that one.
Personally, I'd go for void, and implement FOO() like this:
void FOO(int a, int b)
{
int c = a;
a = b;
b = c;
}
Kidding ..
Anyway, the point I wanted to make is:
For some methods of an API, just the list of name, return type, and arguments is
enough. The name will imply the function. Anyone can then write their own
implementation of said method (including documentation if they so desire).
For other methods, a concise description of what the method does, its eventual
side effects and constraints, will be needed in order to implement it.
In a sense, definition and documentation of the API are linked (you have to
spell out what exactly it is your method does in plain Geek, for those who don't
immediately recognize it from the name and arguments).
All that is ever needed to make use of the API (as opposed to implementing it),
is the list of name and types. That part is an abstract convention (didn't we
use to say 'calling convention' for something like this?). Claiming copyright
protection to an abstract convention doesn't seem right. Nothing fixed in any
medium (that would be implementations, or documentation).
The structure, sequence and organization of the written expression of the
concept either entirely follows that of the concept (the 'definition') or very
closely matches that of the concept (the 'documentation'). Minimal freedom of
expression. Not a lot of creativity as I understand it.
Unless 'API definition' in object oriented languages is a lot more expressive
than that. And not just because you can give your method arguments (parameters)
expressive names.
-- mschmitz
[ Reply to This | Parent | # ]
|
|
Authored by: rcsteiner on Friday, May 04 2012 @ 10:23 PM EDT |
Hmmm. I thought it would be obvious that I was referring to the original author
of an API in my previous comment.
The author of an API writes the code, the documentation, or both. If that isn't
done, it remains in their thoughts and is not particularly useful to others.
:-)
Programmers other than the author would require some sort of description ...
like the above ... in order to use it.
Upon seeing the description by the author of the API, either in code or in
documentation, assuming that description is written in a relatively standard
manner, a competent programmer will realize what is required to use the API in
question.
Is that better? :-)
---
-Rich Steiner >>>---> Mableton, GA USA
The Theorem Theorem: If If, Then Then.[ Reply to This | Parent | # ]
|
|
|
|
|