In his book A Deepness in the Sky, sci-fi author Vernor Vinge describes the profession of Programmer Archaeologists. The basic idea was that in the far future, pretty much every piece of software you could imagine has already been created. So, rather than creating new software, the job of the Programmer Archaeologist would be to search for software close to what you wanted, and then adapt that software for your particular needs.
There is a forthcoming paper at UIST2007 (User Interface Software and Technology)that takes us a step closer to this world. Entitled Assieme: Finding and Leveraging Implicit References in a Web Search Interface for Programmers (PDF), it describes a search engine that provides not only documentation of APIs, but also finds snippets of examples. A nice idea, and well-executed.