Re: These are identical, right? char const* and const char*
From: John Carson (donaldquixote_at_datafast.net.au)
Date: 03/22/04
- Next message: Thomas Matthews: "Re: error while creating project file"
- Previous message: Buster: "Re: exclude headers from -W -Wall -ansi -pedantic"
- In reply to: Hattuari: "Re: These are identical, right? char const* and const char*"
- Next in thread: Hattuari: "Re: These are identical, right? char const* and const char*"
- Reply: Hattuari: "Re: These are identical, right? char const* and const char*"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Mar 2004 02:04:16 +1100
"Hattuari" <susudata@setidava.kushan.aa> wrote in message
news:coydncl3me_vTMPd4p2dnA@speakeasy.net
> John Carson wrote:
>
>>
>> C++ is consciously minimalist because
>>
>> 1. it is meant to run on everything from mainframes to desktops to
>> embedded systems and many of the systems it runs on don't have
>> things like files or screens or threads or ...
>
> Java was originally an embedded systems programming language, and has
> never completely left the domain. There's a lot of new focus in that
> area as well.
So what. The point is that C++ has been designed from the start, middle and
end to be a language that can run on a vast array of platforms. This has
been one of the reasons for not including things desired by people who want
to program for just Windows, Linux and Macintosh.
>> 2. incorporating everything into the language means not taking
>> advantage of the unique features, or adapting properly to the
>> limitations, of each platform.
>
> That really depends on the infrastructure supporting the language.
> C++ can't do anything without a compiler unless its running on some
> kind of interpetting hardware or 'virtual machine'. Java can be
> compiled with the same compiler I use to compile C++, so I'm not sure
> exactly what advantage I gain at the platform level with C++.
You gain working directly with the platform API in your code and thus fully
exploiting API features, i.e., learning all of those extra things that you
don't want to learn gains you the full power of the platform. Microsoft
introduces a new set of APIs every time it brings out a new version of
Windows and these are instantly available to Windows C++ programmers. It
is a similar story for other platforms. No language can reproduce all of
these platform specific features. And, yes, I know that it is possible on
some platforms to call native APIs from Java code. Where possible, this is
not usually pleasant or efficient and, in any case, actually taking
advantage of it means that you have to learn all the extra things that Java
was supposedly saving you from. Java becomes a second-rate C++.
Tradeoffs have to be made. C++ has chosen to focus on core features that can
run on a vast array of platforms. It then gives you the choice of using
third party cross platform libraries or of using platform specific APIs for
those things not covered by the standard. That is the niche that C++
targets, and there seems to be plenty of demand for it. Java targets a
different niche but I am tired of pointing out that it is not the only valid
one.
> Some of those reasons may have not been seriously reexamined in the
> past decade.
I think barely a day goes by without them being re-examined.
> But that really isn't addressing my point. My point
> was that there is considerably more to learn with C++ to get to the
> point where i can work in the same areas I can in Java with far less
> initial learning.
I have already responded to that. It is true and there are good reasons for
it. Of course, it is only true because of the things that you want to do. If
you just wanted to write algorithms, for example, then it is probably not
true. If you really want to get up and running in a hurry, then Visual Basic
is even easier than Java (or so I am told).
> I've seen a proposal to add class and function synchronization to the
> core language.
I don't know what "class and function synchronization" is. If you mean
getting rid of free functions, then that would be a disaster. In fact, this
makes me doubt that this can be what you mean since no-one in their right
mind would make such a proposal.
> Personally, I believe changing the default character
> set to UTF-8 would be a lot more beneficial than native threading.
Of course you do --- because you want C++ to be designed for your benefit
and can't see that others have other interests. Windows 95/98/ME used single
byte (8 bit) character sets or a Microsoft-specific "multi-byte" character
set. Windows NT/2000/XP can use, in addition, UCS-2, which Microsoft is
standardising on (UCS-2 can also now be retrofitted to Windows 95/98/ME).
Thus making UTF-8 the default would alienate all Windows C++ programmers; it
would be a disaster and for that reason is never going to happen.
> No, it's not a question of it being unfamiliar. It's a question of it
> having features which I believe are not ideal. Because I can point
> to Java and show an example of something with that feature doesn't
> mean that I got the idea from Java. Mathematica uses UTF at the
> core, and I've known about UTF for far longer than I've known about
> Java.
Right. You are familiar with Java and Mathematica, so therefore everyone
should use what you have liked about them. The fact that you don't have a
clue about Windows or numerous other systems doesn't stop you thinking that
you know what is best for the C++ standard.
>> The answer hasn't changed. It is
>> because C++ has to satisfy many people besides you. Some relevant
>> comments by Stroustrup are in the links below.
>
> Finally you understand. So you are agreeing with me now?
I have no idea what you mean by this but I am certainly not agreeing with
you.
-- John Carson 1. To reply to email address, remove donald 2. Don't reply to email address (post here instead)
- Next message: Thomas Matthews: "Re: error while creating project file"
- Previous message: Buster: "Re: exclude headers from -W -Wall -ansi -pedantic"
- In reply to: Hattuari: "Re: These are identical, right? char const* and const char*"
- Next in thread: Hattuari: "Re: These are identical, right? char const* and const char*"
- Reply: Hattuari: "Re: These are identical, right? char const* and const char*"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|