Dive Into Java?

Diez B. Roggisch deets at nospam.web.de
Tue Oct 10 10:18:04 EDT 2006


Christophe wrote:

> Diez B. Roggisch a écrit :
>> The code _generated_ by the java compiler, and the C++ compiler, is not
>> the issue here. If you as a programmer can write "a" + "b", its fine.
>> Which is a thing to reach in C++, a bazillion of string-classes have been
>> written....
>> 
>> 
>> and in C++, you can do:
>> 
>> char *a = "1";
>> char *b = "2";
>> char *c = a + b;
>> 
>> But with a totally different, unexpected outcome.. I know where *I* start
>> laughing here.
> 
> That code doesn't even compile. And you shouldn't be using the char*
> compatibility strings in C++ if possible.

It was out of my head. I remember producing some wicked pointer arithmetic
example of similar ridicule. 

And the whole argument is about java having a lot of design decisions that
make it easier to work with is actually strengthened when you say that "you
shouldn't use the char* ..." - because its not forbidden, and maybe someone
else didn't follow that suggestion. I remember quite a few times calling
the stl-string-to-char-function (no idea how that is called now)

Diez



More information about the Python-list mailing list