Re: These are identical, right? char const* and const char*

From: Hattuari (susudata_at_setidava.kushan.aa)
Date: 03/23/04


Date: Mon, 22 Mar 2004 20:42:28 -0500

John Carson wrote:

> "Hattuari" <susudata@setidava.kushan.aa> wrote in message
> news:coydncl3me_vTMPd4p2dnA@speakeasy.net
>> 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.

Or AIX, or Solaris, or FreeBSD, or BeOS, or HPUX, or Netware, or ...

But there are many features in the standard library which /are/ directed
toward a general purpose OS. The argument for ASCII goes something like:
every character we put in the computer takes up memory, we only have a few
K to work with, and besides the is America; we don't need anything but
ASCII.
 
> 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.

All those extra things I don't want to learn? What exactly are those? I can
work directly with the system API in Java as well.

> 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.

Uh, there's been some debate about that issue from time to time. <ROFLMAO>

> 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.

So how does this address the fact that some things that could be specified
in the standard, are not? Such things as fixed ordering of modifiers in
declarations, or default sizes for fundamental types? A bunch of
handwaving generalities are not persuasive.
 
>> 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).

Have you read _The_Java_Programming_Language_, by Arnold, Gosling & Holmes?
I have, and I have it sitting right here. I've also read all but 60 pages
of the core langueage part of TC++PL SE. When I get finished with this
message, I intend to finish the last two chapters. C++ has far more
subtelties than does Java, so I can't say I understand what I've read as
well as I did the Java counterpart. I've also read K&R, as well as Cooper's
_Standard_Pascal_, several sections of the ECMAScript standard, The
introductory sections of the GNU Lisp Reference Manual, the core sections
of the Mathematic Book, and probably other de facto, or actual language
standard specifications.

There are useless ugly features of C++ that are never changed because the
advocates of change don't want to deal with the entrenched opposition who
refuse to reexamine the reasoning that led to the original decision.

>> 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.

Class level (or perhaps I should say 'object level') locking, or function
level locking. I'll have to review the details, but it basically is the
distinction between locking on the whole object or locking on a member
function.

>> 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.

OK, I'll play along. Make UCS-2 the standard, and provide support in the
library to convert to UTF-8. AFAIK, that's pretty much a compressed form of
UCS-2. That is reasonable enough. The w3c is standardized on UTF-8, thus
there is enough demand/justification to provide such a conversion facility.
The main reason for advocating a larger character set is not "what I know",
it is because the larger character set will encompass more natural
languages as well as more technical symbols. Note that the OS I use was
built using the current C++ specified character set which C++ inherited
from C. What I know best is what C++ currently supports by default.

> 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.

Uh, so far as I know, Microsoft is using Unicode in everything NT based, and
has support for it in all their WinDOS OS's as well. Note I didn't say
Mathematica is UTF-8 at the core. When I installed Windows NT on my system
in October 1992, its native character set was Unicode. Has that changed?

-- 
p->m == (*p).m == p[0].m


Relevant Pages

  • Re: These are identical, right? char const* and const char*
    ... > embedded systems and many of the systems it runs on don't have things like ... Java was originally an embedded systems programming language, ... > aware that the omission of many things from the standard is inconvenient ...
    (comp.lang.cpp)
  • Re: C, really portable?
    ... > Wait, is Java a modern language superior to C, or is it still ... It is a much better OO language than C++, ... It depends what you are doing, Java aims for rigorous portability - the same ... regardless of platform. ...
    (comp.lang.c)
  • Re: C, really portable?
    ... >> Wait, is Java a modern language superior to C, or is it still ... It is a much better OO language than C++, ... on one platform then behave pathologically ... > It depends what you are doing, Java aims for rigorous portability - the ...
    (comp.lang.c)
  • Re: Borland and Java obsession.
    ... top of another platform. ... With any other language once compiled you have ... Moreover with Delphi and C++ Builder I can write experts using the same ... Can I do it with CBuilderX, or I have to write Java ...
    (borland.public.delphi.non-technical)
  • Re: C# vs. C++ Calling the overridden base class members from derived classes.
    ... This is the first time you have ever suggested anything of this ... > about second-guessing the standard. ... It is often possible to accomplish through design approach in one language ... If not, the intent is not to replace Java, it is to defend against Java by ...
    (comp.lang.cpp)