YOU DON'T HAVE TO REINVENT THE WHEEL

No matter which language you're using, there are a tremendous number of resources available to make your job easier. You may find that someone has already written the exact subroutines or class libraries that you need.

A common nomenclature for referring to libraries is API (Application Programming Interface). You often see the word interface used when talking about language libraries. Just as the phrase air-water interface means the boundary surface between air and a body of water, and graphic user interface represents the boundary between the user and a computer, a programming interface represents the boundary between your program and library functions.

Standard Libraries

Many modern languages come with extensive libraries of their own. During the initial explosion of interest in Java, Sun created so many different APIs that most people became confused as to what is a standard part of the language and what is an add-on library. Sun finally got wise and created three editions of Java.

  • J2ME ( Java 2 Micro Edition ) : A set of libraries suitable for people working with small systems such as cell phones.
  • J2SE ( Java 2 Standard Edition ): A set of libraries suitable for most programming.
  • J2EE ( Java 2 Enterprise Edition ): A set of libraries suitable for those working on the largest scale of commercial Web sites and other applications. (Really complicated -- don't try to start here!)

Many other commercial language vendors follow a similar approach and have editions at various levels. For example, the starting version of Liberty Basic is limited in certain areas and doesn't permit the creation of stand-alone programs.

The C++ language has recently seen the STL ( Standard Template Library ) become a standard part of the language. The STL contains a wide assortment of mathematical and functional tools, as well as a full-featured string class. Having these tools available for use can save incredible amounts of time.

Object-Oriented Language Libraries

One big advantage of OOP (Object-Oriented Programming) is the ease with which you can make use of library functionality. You have basically two ways to make use of an OOP library: You can create instances of a library class, or you can extend a library class.

In Lesson 4, you created a new Java class MyFrame by extending a library class named Frame . Frame is an example of a library class designed to be easily extended. As discussed in earlier lessons, by extending Frame , you inherit the variables and functions that make it easy to create a new user interface.

Other libraries are designed with self-contained functionality that you can plug into programs where needed. In the MyFrame example, the following line created an instance of the Label class, customized with the text message and positioning instruction.

add( new Label("Hello World", Label.CENTER ));

Online Information

Having a connection to the Internet is similar to having a nearly infinite library at your command. Unfortunately, you have to act as your own librarian to locate the resources you need, but you'll find that search engines are a big help.

Many vendors of programming languages have extensive online reference material for their programming libraries. For example, one starting point to navigate Microsoft's huge supply of technical information is the MSDN Library site . Here you can find both general articles on programming techniques as well as specific details on the libraries available for the .NET family of languages.

Open Source Libraries

The Internet has made it possible for people from all over the world to involve themselves in creating programs and programming libraries in astonishing profusion. The products of these projects are typically freely available to anybody who wants to use them, which is why they're called open source. Probably the most famous open source product is Linux. Its development is discussed in the thought-provoking " The Cathedral and the Bazaar " essay by Eric S. Raymond.

There are many Web sites where these projects are coordinated. If you did the assignment for Lesson 4, you've already discovered some of these sites. Two good examples are Sourceforge (y'gotta love the name) and the Apache Software Foundation , home of the widely used Apache Web server and many other projects in many languages. Sourceforge now hosts over 60 thousand open source projects.