Tuesday, May 1, 2012

Is an API copyrightable

I'm a programming geek, and being in the kind of programmer culture that we have on the internet today, I love everything open source, or open in any other way, at least if it's not just a word in the marketing material. With the conflict between google and Oracle, around the IP theft of java API's, I started to think about the consequences it could have when API's get copyrighted.

What's an API?

You're probably using a twitter client on your mobile devices. Those twitter clients need some way to pull in the data from your twitter stream, and to post a new tweet, when you're drinking the best coffee in the world at your local starbucks, and feel the need to let the whole world know about it. To allow for this to happen, twitter built an interface, that programmers can use to hook their application into twitter. Such an interface is called an Application Programming Interface. But an API can also exist within one application. Take for example your word processor. Let's imagine that there is a component that keeps track of the current style settings such as color, font and font size. Such a component is not responsible for drawing the buttons on the screen that control these properties. So, when you use the mouse to click to select a color in the user interface, the component that reacts to that click, needs to have a way to communicate with the style component, and that's where that component's API comes in. The component exposes certain functions that can be executed in order to get or change style settings.

What we call the API is just the set of functions exposed, without considering the implementation, so we don't care how the style properties from our example are stored or retrieved.

The problem

Oracle is now claiming that google has infringed their copyright, by copying the structure of their API. I find this rather logical, many components used in many software applications have only one, or very few ways to structure them logically. Take for example our style component. it would logically have some of the following functions defined in it:

  • get_font
  • set_font
  • get_font_size
  • set_font_size
  • get_color
  • set_color
  • ...
There is no other logical way to define this API. Now, imagine that the set_color function could take a color as a parameter, which would be a component in the program too, with functions like:
  • set_rgb
  • set_hsl
  • set_cmyk
  • ...
These functions are just creating colors based on commonly used color schemes. It would not make sense to create a new scheme, as not to infringe anyone's copyright.

The implementation

I do think that copyright should stay applicable to the implementation of a system, although the system has to be large and elaborate enough. There aren't that many ways to get the greatest common denominator of a set of numbers, so copyrighting that obviously would be a bad idea, but there can really be a lot of difference between different implementations for a spreadsheet application, so it's a good idea to copyrigt Excel or Numbers.app.

5 comments:

leave an interesting or creative response.