Why does Java have central API documentation but not C ++?

The question pretty much explains all this. I was wondering why Java has beautiful, organized, and centralized API documentation, but C ++ library definitions seem to be scattered across the Internet?

Is it because Sun has put a lot of effort into simplifying and making Java API documentation easy to access? Thanks in advance.

+6
source share
4 answers

What you call the "nice, organized / centralized, API" for Java is probably the official Oracles implementation document. C ++ implementations also have their own documentation, for example, the GNU implementation is well documented at http://www.gnu.org/s/libc/manual/ (part C), and at http://gcc.gnu.org/ onlinedocs / libstdc ++ / (part of C ++, see the "API and source documentation" section). You can also find full documentation on Microsoft C ++ implementation in the MSDN library.

You will probably find the Java API more concise and well documented, because there is only one serious implementation (the original implementation of Oracle), which makes its documentation the resource itself for the language itself.

On the other hand, C ++ is a standard implemented by a wide range of suppliers, and many documentation resources are not even based on any particular implementation, but on the standard itself. After all, various C ++ resources on the Internet tend to be superior to others in some areas. For example, cplusplus.com will concentrate good documentation on the topics <iostream> , <string> and beginners, and the documentation on implementing SGI STL (http://www.sgi.com/tech/stl/) has become a reference resource for STL, probably due to its completeness and very good organization.

+10
source

C ++ has a language specification and a set of standard libraries.

Java also has a language specification, and also has a set of standard libraries.

I do not see a fundamental difference between C ++ standards and Java standards, except that Java also comes with a standard implementation (from Oracle, formerly Sun).

PS: Of course, Java has a standard API for GUI (Swing), but C ++ doesn’t. But do you really want to force a “standard” like Windows MFC to exclude alternatives like Qt?

+3
source

The difference is that the C ++ standard library is not as well defined as the Java equivalent. The C ++ standard leaves many possibilities for the implementation in some cases to differ in different ways; luxurious Java does not provide. So, for Java, as soon as you have one good quality set of documents, everything is ready ... everything you need to know is right there. But with C ++, the STLPort documentation will not necessarily correspond to Dinkumware, for example, and you will get a lot of scattered documentation.

+2
source

One reason is that C ++ is not tied to a single provider, so by default it is not centralized.

Another reason is that Java provided documentary comments as part of the language, and Javadoc was available from the start as one of the standard JDK tools. This affected the availability of API documents. Creating an API document has always been a natural step in the Java assembly model.

C ++ is a completely different story. I met the following Nathan Myers comment on GCC basic_string.h .

Documentation? What is it?

Only recently did Doxygen set the de facto standard. For a long time, documenting comments was like black magic. Each project was based on its own tools, and although some projects had very good documents, these tools were not available for general use. I remember people asking Trolltech to release the Qt documentation tool, but it didn’t.

+1
source

Source: https://habr.com/ru/post/900870/


All Articles