Why doesn't C++ have comprehensive API like Java?

G

Gernot Frisch

By requiring such types to be available restricts the portability.
Having
them available if the platform supports them might be nice, though.
On the other hand... how often are these types needed? Is it not
only rarely you use these types in portable code?

But if all interfaces would use them, noone would typedef "real" or
BYTE or crap like that. It should be standart. Also, int, short and
long could stay, but if I want to have 32 bit, there should be a
reliable, portable way to geth them.

Anyway...

-Gernot
 
V

velthuijsen

Well an int that is guaranteed to be 64bits would be nice with the
arrival of the 64 bit procs.
Not to mention it would allow me to have a portable version of the
double comparison trick I use :)
 
I

Ioannis Vranos

Phlip said:
Oh dear. The entire arc of my argument just collapsed. Folks, C++ needs a
Standard Platform, enforced by statism.


Ruby maybe OK for application development, however always remember that all those run-time
features imply overhead, while C++ aims to be a systems programming language, while it is
also suitable for application development.

And again, there can be a C++ implementation providing all Ruby features as system extensions.
 
I

Ioannis Vranos

Gernot said:
But if all interfaces would use them, noone would typedef "real" or
BYTE or crap like that. It should be standart. Also, int, short and
long could stay, but if I want to have 32 bit, there should be a
reliable, portable way to geth them.


I could never understand why those aliases are used in Win32 API (in .NET things are
cleaner, int etc are used in C++ unless you want to use the .NET name like Int32).

int in the specific platform can store 32-bit values, and I assume BYTE etc in Win32 can
also store specific ranges, as in any platform, so I am not sure you are making a case here.


There is the guarantee that short and int can store at least of 16-bit values and long at
least 32-bit values.

So for example, if you want to be sure that you can always store 32-bit values in portable
code, you can use long.
 
I

Ioannis Vranos

Well an int that is guaranteed to be 64bits would be nice with the
arrival of the 64 bit procs.
Not to mention it would allow me to have a portable version of the
double comparison trick I use :)

C++0x will probably adopt C99 long long type, which is guaranteed to be able to store
64-bit values at least.

I would rather they name it llong or something similar though.
 
J

Jason

somebody said:
No, I'm not a troll, just angry. I just started learning
C++, and find it extremely lacking compared to Java.

Still, I'm somewhat
disappointed with C++, and wish they would add some more
standard functionality like networking or HTTP type classes.
Well, there's my rant, I feel better now. If I'm wrong,
I just don't see it.

Your feelings are understandable, but it's important to keep things in
perspective.

Java is like a fine restaurant, where you can order anything you like,
but sometimes the *only* way to get the filet mignon is to accept the
salad, wine, and dessert along with it.

C++ is like a food court. You can get pretty much anything you want,
but you have to pick and choose if you want a full multi course meal.

(just for completeness) C is like a grocery store. You can make
anything you want, but you better enjoy cooking!

In the end it's all a matter of your personal style (and your company's
time).

-Jason
 
M

Mike Wahler

Ioannis Vranos said:
C++0x will probably adopt C99 long long type, which is guaranteed to be
able to store 64-bit values at least.

I would rather they name it llong or something similar though.

I don't think it should have been called 'long long' at all.
Instead, 'very long'. Then when wider longs are added, they'd
be 'very very long', 'very very very long', etc.

Yup, it's a slow day today. :)

-Mike
 
G

Gary Labowitz

Mike Wahler said:
I don't think it should have been called 'long long' at all.
Instead, 'very long'. Then when wider longs are added, they'd
be 'very very long', 'very very very long', etc.

Mike, you took me back to the 60's when we were starting to work with VHF
and UHF spectrum allocations. Some British worker suggested a band called
VHFI which stood for "Very High Frequency Indeed!"
 
S

somebody

| I don't understand at all how you can arrive at that conclusion.
| Have you seen Java's API documentation?
|

You can count on it that Phlip and many other C++ coders have "seen"
the Java API documentation :).

But you missed the whole point.
If you don't write system applications, or low level code in general
like engines, you (or anyone) shouldn't be bothered by C++ to
start with.
- Val -


I disagree with this completely. There are numerous applications written
in C and C++. Most applications right here on my Linux box are mostly
written in C. I developed commercial software that I wrote in Visual
C++ many years ago, although VC++ is an application framework as opposed
to a language. It's just after years learning other languages, I thought
C++ would have evolved to include more standard functionality. I guess
what I really want is an API like Java, with the speed of C. Wishful
thinking I know.
 
P

Phlip

somebody said:
... It's just after years learning other languages, I thought
C++ would have evolved to include more standard functionality. I guess
what I really want is an API like Java, with the speed of C. Wishful
thinking I know.

Absolutely. Besides Qt/KDE, wxWidgets, Gtk+/Gnome, Win32, MacOSX, and Motif,
the C languages just don't seem to have any APIs like Java...
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top