An example without an analogy:
In C, there is a function (think method -
they are almost the
same thing) named printf(), which does formatted
printing. It does this by taking as first parameter a format
string
and individual items to insert into the format string
as further
parameters.
There is a convention for the format string for types of
parameters; for example, "%d" means "insert a decimal
integer here".
So, for example, the code
printf("Bob is %d years old.",
37);
would print "Bob is 37 years old".
Now, if you change
the implementation of printf
so that it's no longer "%d" but
"$d" that
specifies a decimal integer, you have not changed the
signature
of the printf() function in any way, but you
certainly have
broken the API.
The proposition "You have broken
the API" is roughly
equivalent to "You have changed the
implementation so that programs that relied
on the
previous functionality no longer work in the same way". One way
to do
this is to change method signatures, which may result in
old programs failing
because you try to pass an integer where a
string is required, or because you
are trying to call a method
which does not exist. Another way to do this is to
change the
behavior of the code so that it's not backwards compatible. [ Reply to This | Parent | # ]
|