Why doesn't C++ have comprehensive API like Java? (Cont'd.)

S

somebody

I'm posting a new message regarding this subject,
since the one posted previously is getting rather
large. I just received the June 2005 issue of
Dr. Dobb's Journal, and it contains an article
titled "The Technical Report On C++ Library
Extensions". After debating this issue with
various group members, all I can say is:
I Win!!! (Just kidding)

Anyway, here are a couple of quotes from the article,
which reflect my sentiments exactly:

"The Perl, Python, and Java standard libraries include
facilities for parsing XML, performing regular
expression searches, manipulating image files, and
sending data over the network. From that perspective,
the C++ standard library looks like it's only the
beginning. And everyone in the standards committee knows
that of course."


"The question isn't whether we need a more comprehensive
library, but how we get one".
 
P

Phlip

somebody said:
...I just received the June 2005 issue of
Dr. Dobb's Journal, and it contains an article
titled "The Technical Report On C++ Library
Extensions"...
"The Perl, Python, and Java standard libraries include
facilities for parsing XML, performing regular
expression searches, manipulating image files, and
sending data over the network. From that perspective,
the C++ standard library looks like it's only the
beginning. And everyone in the standards committee knows
that of course."

The distinction is systems like XML are also themselves standards (actually
"recommendations"), so they already have cross-platform support.

The C++ Standard Library will probably expand, and that's what the C++
thought leaders invest in Boost.org. However, there are no equivalent widely
adopted recommendations for GUIs. Such a "standard" would be Jack of All
Trades, Master of None. The C++ Standard Library will not enforce a GUI any
time soon.

Again: What is the point of letting some dumb committee somewhere decide for
you which GUI to use?
 
P

Phlip

somebody said:
"The Perl ... standard libraries include
facilities for parsing XML

I couldn't let that one past.

Perl has no XML "standard" anything. It only has a smattering buggy,
half-started modules thrown onto CPAN.

(Ruby, by contrast, has a coherent and fully useful XML library, bundled
with its core distribution.;)
 
W

Wiseguy

Phlip said:
I couldn't let that one past.

Perl has no XML "standard" anything. It only has a smattering buggy,
half-started modules thrown onto CPAN.

(Ruby, by contrast, has a coherent and fully useful XML library, bundled
with its core distribution.;)


God, I miss FORTRAN IV...

"A real programmer can write FORTRAN code in any language." -- Real Programmers
Dont Use Pascal, DATAMATION, July 1983.
 
S

somebody

The distinction is systems like XML are also themselves standards (actually
"recommendations"), so they already have cross-platform support.

The C++ Standard Library will probably expand, and that's what the C++
thought leaders invest in Boost.org. However, there are no equivalent widely
adopted recommendations for GUIs. Such a "standard" would be Jack of All
Trades, Master of None. The C++ Standard Library will not enforce a GUI any
time soon.

Again: What is the point of letting some dumb committee somewhere decide for
you which GUI to use?


I'm not concerned with GUI development. All of the other items mentioned,
like regular expressions, network classes, imgage manipulation, etc.,
are what I'm referring to. These could be added as library extensions,
without bloating the core C++ classes. You use them if you want to.
 
P

Pete Becker

somebody said:
I'm not concerned with GUI development. All of the other items mentioned,
like regular expressions, network classes, imgage manipulation, etc.,
are what I'm referring to. These could be added as library extensions,
without bloating the core C++ classes. You use them if you want to.

Image manipulation in the C++ Standard? Dream on.

More to the point: everything that's in the standard has to be provided
by every compiler vendor for every platform. Doesn't matter whether you
want to use them -- they have to be there. That means you pay more for
the compiler. (I don't mind: that's how we make our living.)
 
I

Ioannis Vranos

somebody said:
I'm not concerned with GUI development. All of the other items mentioned,
like regular expressions,

Needed for string manipulation.
network classes, imgage manipulation, etc.,


Image manipulation does not make sense in embedded devices like watering systems, or
telephone centres. So, it will not be added in the standard. I am not sure networking will
make it too in the end.

This does not mean you can not do image manipulation or networking with C++. For example
these days I am reading about .NET networking facilities, and have read about its 2D
graphics facilities in the past.


Do not confuse a language (syntax) with a platform. In essence, Java the language comes
with no facilities of its own, the facilities are of the JVM platform.


In contrast C++ uses the facilities of a platform (e.g. .NET) *and* comes with its own
library.

are what I'm referring to. These could be added as library extensions,
without bloating the core C++ classes. You use them if you want to.


Yes. However the standard library is required to be implemented in all C++ implementations
and the facilities that are added are the most needed, generic and efficient ones. And C++
is not only an application development language but also a systems programming language
(you can program the bare metal).

In contrast with Java you are programming applications for the Java Virtual Machine, but
you can not write the Java Virtual Machine with Java.
 
P

Phlip

somebody said:
I'm not concerned with GUI development. All of the other items mentioned,
like regular expressions, network classes, imgage manipulation, etc.,
are what I'm referring to.

Which network? Berkeley sockets? Samba? ATM? Ethernet?
 
S

somebody

In contrast with Java you are programming applications for
the Java Virtual Machine, but
you can not write the Java Virtual Machine with Java.

Yes, good point. I would still like to see extensive library
extension additions for C++, making it a more comprehensive
language for application programming. As it stands, you need
a framework like Visual C++ or wxWidgets to be productive.
 
I

Ioannis Vranos

somebody said:
Yes, good point. I would still like to see extensive library
extension additions for C++, making it a more comprehensive
language for application programming. As it stands, you need
a framework like Visual C++ or wxWidgets to be productive.


You always need a platform (framework) for application programming. Java just targets a
specific one (JVM).


If JVM was not closed to other languages (it is a proprietary, closed virtual machine),
all languages would be able to target it including C++.

..NET on the other hand is a virtual machine open to all languages. Actually, there is a
standard (initiated by Microsoft) called CLI, which provides the specification of a VM
together with its assembly language, which is available from here:

http://www.ecma-international.org/publications/standards/Ecma-335.htm

..NET is a CLI-compliant VM, and there are other CLI-compliant machines like Mono and DotGNU.


CLI compliant VMs:

http://msdn.microsoft.com/netframework

http://www.mono-project.com

http://www.gnu.org/projects/dotgnu


Code that uses the same APIs in two CLI VMs is *binary* portable to both of them (so for
example the executable of .NET code can run unchanged under Mono, as far as it uses common
APIs).

Mono provides many of .NET APIs as also as some of its own.

So a GUI Form .NET application can run as it is under Mono in Linux, Mac OS X, etc (or in
Windows - Mono provides a Mono implementation (VM) for Windows themselves which anyone can
download and install, as you can download and install the JVM ("Java")).
 
I

Ioannis Vranos

somebody said:
The way Java or Perl handles them.


What you must understand is that development is not the same for everything. There is
application development for PCs, OS development, dedicated-system development (a dedicated
application running directly on hardware like an alarm system), etc.


There are different types of networking (and actually everything), that you can not
provide in a library or in a VM.


You can't include *everything* in something. So when you program in a platform, you use
the platforms features.


When you program for the JVM you use the facilities that JVM provides. In turn, JVM
provides the common facilities of most Operating Systems of *PCs*.


My C++ .NET applications, use the facilities that the .NET VM provides (garbage
collection, GUI etc), which in turn are the most facilities that the Windows OS provides.


Mono on the other hand, does not provide all .NET facilities (like Managed DirectX), but
many of them since it tries to stick with the common features of many OSes (Windows, Mac
OS X, etc) as also some additional facilities of its own (like GTK#).


Once again, in my .NET C++ applications I have garbage collection, since it is a feature
of the VM I am programming for. Another feature I have is every object inheriting from a
base class Object, since it is a feature provided by the .NET VM.
 
L

Lionel B

somebody said:
[...]

"The Perl, Python, and Java standard libraries include
facilities for parsing XML, performing regular
expression searches, manipulating image files, and
sending data over the network. From that perspective,
the C++ standard library looks like it's only the
beginning. And everyone in the standards committee knows
that of course."

"The question isn't whether we need a more comprehensive
library, but how we get one".

Have a look at the article by Bjarne Stroustrup (referenced by the man himself in a post to this ng):
http://www.research.att.com/~bs/rules.pdf. It refers to the upcoming revision of the ISO C++ standard (C++0x) and
addresses many of the issues you raise.
 
O

osmium

Ioannis Vranos said:
Image manipulation does not make sense in embedded devices like watering
systems, or telephone centres. So, it will not be added in the standard.

A watering system doesn't need exp(x) either. But some compilers offer this
exotic capability. How does this fit in with your theory of needs vs.
wants?
 
P

Peter Koch Larsen

osmium said:
A watering system doesn't need exp(x) either. But some compilers offer
this exotic capability. How does this fit in with your theory of needs
vs. wants?
Are you sure? All my watering systems have had good use of exp ;-)
Seriously, an imaging system certainly is less applicability than exp. Also
exp is rather well defined whereas "imaging system" is quite unclear. What
kind of pictures, what requirements a.s.o.
Also exp might need some non-portable library support to implement it
optimally.

/Peter
 
I

Ioannis Vranos

osmium said:
A watering system doesn't need exp(x) either. But some compilers offer this
exotic capability. How does this fit in with your theory of needs vs.
wants?

I think there is a confusion regarding C++ standard libraries vs JVM/.NET/Some_OS dynamic
(run-time) libraries (dlls).
 
S

somebody

What you must understand is that development is not the same for everything. There is
application development for PCs, OS development, dedicated-system development (a dedicated
application running directly on hardware like an alarm system), etc.

Yes, and wouldn't C++ be fantastic if you could do systems programming,
PLUS have all of the functionality of Java? That's what I want.
 
A

Alvin

somebody said:
Yes, and wouldn't C++ be fantastic if you could do systems programming,
PLUS have all of the functionality of Java? That's what I want.

It can. You just need the right libraries (think of them as supplementing
C++). Java is just a language plus a framework that provides you with all
the "libraries". C++ does this but you usually need to obtain the libraries
yourself.
 
P

Phlip

somebody said:
Yes, and wouldn't C++ be fantastic if you could do systems programming,
PLUS have all of the functionality of Java? That's what I want.

By "have all of the functionality", you are saying "comes bundled with".
Java's vendor is Sun.

When you get a C++ platform, it also comes bundled with plenty of libraries.
All the functionality. C++, however, has the added benefit of multiple,
competing vendors, not just Sun.

Competition is Good. For example, Java started with AWT, a sucky GUI
library. They since switched to Swing. So would you like all C++
distributions to bundle a sucky GUI library too? Or are the ISO Committees
somehow prescient enough to order those wacky C++ distributors to supply The
One True Perfect GUI? A GUI so good it deserves the support of international
law?

Oops, sorry everyone. The ISO Committees got it wrong again. We need to
upgrade from C++AWT to C++Swing. Yeah, that's the ticket!

Now what technical problem, on your desktop, are you actually trying to
solve? Or are you imaging a problem?
 
I

Ioannis Vranos

somebody said:
Yes, and wouldn't C++ be fantastic if you could do systems programming,
PLUS have all of the functionality of Java? That's what I want.


Who said you can't? What I have been saying all along? :) My .NET applications have
garbage collection, all objects inheriting from a base class Object and thus I can do:


int x= 7;

String *p= x.ToString();


run-time generics (in .NET 2), templates, etc. However not all of these are suitable or
feasible for systems programming, that's why Standard C++ comes with what is suitable and
feasible on its own (and that's why Java is not suitable for systems programming).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top