For the last couple days at work, I was updating our APIs to reflect a relatively small change I made. The change was small, however updating our APIs is very time consuming, because we support five different languages: Perl, C++, Java, COM, and .NET. Making a change to the API means making a nearly identical change in five different languages, using four different compilers, four different development environments, five different test drivers, and two different platforms (unix and windows).
This drove me crazy. If I ever have to do more work on our APIs, I will try to convince someone to reorganize them. Currently, each API has its own directory, so you have nearly identical code scattered in several different directories. If I had my druthers, I'd colocate corresponding methods, so that I could change them consistently, without losing my train of thought. I'm imagining a very simple preprocessor that takes a single file containing six different languages, and generates six different output files, with one language in each. Even the C preprocessor would probably work -- just use a #define for each language, and run it six times. With a judicous use of macros, you might even be able to get away with only one or two versions for some of the simpler methods (e.g. getters and setters). A more sophisticated preprocessor (like, say, scheme) would probably be even better.
I doubt we'll ever do this at work though. Which is why I had to make a post about it, to get my frustration out.
Posted on September 2, 2003 03:12 PM
More programming articles
I am also interested in computer program translation between different languages.
Posted by: Naveen Garg at April 22, 2008 07:51 PM