Re: some personal rambling on java the lang
Newsgroups: comp.lang.java.programmer,comp.lang.c++
George Neuner <gneuner2@comcast.net> writes:
What Java lacks that limits its utility with respect to C or C++ is
the ability to overlay a logical view of structured data at an
arbitrary memory location. This ability is the single feature of C
and C++ which makes them strictly more powerful than Java.
This is low-level/tool-level wording. (There is nothing wrong
with this per se, but ...)
A program eventually has to perform some function that often
can be defined not using terms of a specific programming language.
For example, ?display an adjustable alarm clock?.
Often such a problem will be implemented in Java using other
means, where such a memory overlay is not required.
First, there is no way *reliably* to obtain an arbitrary location
mapping on memory.
I don't know what a ?location mapping? is, but if you
refer to converting an integer to a pointer type: The result
of such a conversion is implementation-defined in C.
?An integer may be converted to any pointer type. Except
as previously specified, the result is implementation-
defined, might not be correctly aligned, might not point
to an entity of the referenced type, and might be a trap
representation.?
ISO/IEC 9899:1999 (E), 6.3.2.3, p5
If we allow for implementation-defined features, then a Java
implementation can offer such a mapping, too, via JNI.
If we want to write portable code, it cannot be used
neither in C nor in Java.
For C++, I am not able to find any word on such a conversion
in chapter 4 ?Standard conversions? of ISO/IEC 14882:2003(E).
So what? C++ has this feature called a "library" that, among other
things, allows you to use functions that you didn't write.
The Journal "COTS" reports that the military migrates away
from Ada towards Java. The /portable/ libraries of Java are
recognized as an edge over C++.
?Another advantage Java offers is a broad selection of
standard, portable and scalable libraries. That's where
it has an edge over C++. While C++ has some good
libraries, they're not portable---one set of libraries
is needed with Windows, a different set is needed for
Solaris, and yet another for Linux.?
Jeff Child
http://www.cotsjournalonline.com/pdfs/2003/07/COTS07_softside.pdf
For example, you can write a web spider, that will download
a hierarchy of web pages into a hierarchy of directories
with a GUI in /portable/ Java code (stricly speaking: Java SE).
Nothing of this is possible in portable C++ code: Can't access
the web, can't create directories, can't build a GUI, and so on.
See also:
http://www.purl.org/stefan_ram/pub/c++_standard_extensions_en