Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Thanks... 148 4852
BillJosephson wrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Yes C++ is basically just a clone of some of the simpler to understand
Java features.
That really limits its usefulness but makes C++ very easy to learn.
Most people can pick it up in a couple of days.
regards
Andy Little
BillJosephson $B$N%a%C%;!<%8(B:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Thanks...
Real world apps need more features and functionalies than just
class-class relations and coders'handles on them. C++ is an OOP
language but C++ can't create a GUI itself without third party libs.
On Jan 19, 3:31 pm, "BillJosephson" <billjoseph...@hotmail.comwrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Well, I don't know of any comparison but personally I'd say that C++ is
a superset of Java, way more powerful. Truth is that I don't think that
there is much that, from an application level programmers point of
view, you can do in C++ that you can't do in Java or the other way
around (if we are just looking at the language and not bringing
libraries in). They are different languages with different abilities
which leads to different solutions, but I think you can solve all
(most) problems with any of them. The question is just how.
Personally I feel a bit confined when using Java, I often come across
situations where I know I could have solved a problem really easy and
elegantly with C++ but Java does not support that kind of programming,
maybe it's just because my way of thinking is closer to the C++ way
that the Java way, but I've always felt more in control with C++. Just
look at a parameter to a function, in Java an object is passed by
reference and a built-in type (int, double etc.) are passed by value.
In C++ I can choose if I want to pass any parameter by value, reference
or pointer.
If you want to learn OOP by all means try C++. It might be a bit harder
than Java at first, there are lots of rules and things to keep in mind
but the basics are quite easy and the rest comes with experience, and
if there is anything you are wondering about you can always ask your
question here or in comp.lang.learn.c-c++.
And you might want to read the excellent FAQ: www.parashift.com/c++-faq-lite/
--
Erik Wikström
BillJosephson wrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Java has features that C++ doesn't have, and C++ has features that Java
doesn't have. If any, I'd call Java the subset, because quite some features
have been removed to make the language simpler.
"kwikius" <an**@servocomm.freeserve.co.ukwrote in message
news:11**********************@51g2000cwl.googlegro ups.com...
>
BillJosephson wrote:
>Want to do OOP. Does c++ have all the abilities of java, or is it some subset?
Yes C++ is basically just a clone of some of the simpler to understand
Java features.
That really limits its usefulness but makes C++ very easy to learn.
Most people can pick it up in a couple of days.
regards
Andy Little
Was this pure sarcasm or have you mistakenly swapped the words "C++" and
"Java"?
- Sylvester
Rolf Magnus wrote:
BillJosephson wrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Java has features that C++ doesn't have, and C++ has features that Java
doesn't have. If any, I'd call Java the subset, because quite some features
have been removed to make the language simpler.
Thanks much for the responses.
Hm, I'm surprised by this, given what other people have told me.
Aside from the differences in parameter passing Erik mentioned, what
can C++ do that java is lacking?
Sylvester Hesp wrote:
"kwikius" <an**@servocomm.freeserve.co.ukwrote in message
news:11**********************@51g2000cwl.googlegro ups.com...
BillJosephson wrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Yes C++ is basically just a clone of some of the simpler to understand
Java features.
That really limits its usefulness but makes C++ very easy to learn.
Most people can pick it up in a couple of days.
regards
Andy Little
Was this pure sarcasm or have you mistakenly swapped the words "C++" and
"Java"?
If the O.P wasnt a troll then I wasnt being sarcastic.
To be honest I would in fact prefer to use Java to C++, if it had the
features, because it has comprehensive libraries which actually work
with each other. Java has libraries and no features. C++ has features
and no libraries.
Maybe I'll move to C++/CLI ...
regards
Andy Little
Erik Wikström wrote:
On Jan 19, 3:31 pm, "BillJosephson" <billjoseph...@hotmail.comwrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Well, I don't know of any comparison but personally I'd say that C++ is
a superset of Java, way more powerful. Truth is that I don't think that
there is much that, from an application level programmers point of
view, you can do in C++ that you can't do in Java or the other way
around (if we are just looking at the language and not bringing
libraries in). They are different languages with different abilities
which leads to different solutions, but I think you can solve all
(most) problems with any of them. The question is just how.
Personally I feel a bit confined when using Java, I often come across
situations where I know I could have solved a problem really easy and
elegantly with C++ but Java does not support that kind of programming,
maybe it's just because my way of thinking is closer to the C++ way
that the Java way, but I've always felt more in control with C++. Just
look at a parameter to a function, in Java an object is passed by
reference and a built-in type (int, double etc.) are passed by value.
In C++ I can choose if I want to pass any parameter by value, reference
or pointer.
If you want to learn OOP by all means try C++. It might be a bit harder
than Java at first, there are lots of rules and things to keep in mind
but the basics are quite easy and the rest comes with experience, and
if there is anything you are wondering about you can always ask your
question here or in comp.lang.learn.c-c++.
And you might want to read the excellent FAQ: www.parashift.com/c++-faq-lite/
--
Erik Wikström
In Java everything is passed by value. Objects may seem like they are
passed by reference, but in fact the Object References themselves are
passed by value. This may seem like semantics, but it actually isn't.
If you pass an object reference into a function, and inside the
function you reassign the reference to a new heap object. Once you
return from the function, your reference will "point to" the original
heap object. For an example, try writing the iconic sawp(a, b) function
in Java... it won't work. And I wouln't say that Java is simpler than
C++ per se or vice verse. Both languages have features in common and
their own special abilities. C++ seems to give you more low-level
control and seemingly more of an ability to "roll your own"
implementations, however you can usually get that control in Java, its
just more round about. While Java's framework seems to make for faster
implementation (yeah... lets not get into a discussion on how fast you
can code something in each respective langauage)... I will have to say
that my biggest beef with Java is no freakin' unsigned values... that
pisses me off (I believe the char is unsigned, but that really doesn't
help you out)... but everyone has pet peeves with C++ and/or Java...
"BillJosephson" <bi***********@hotmail.comschreef in bericht
news:11**********************@51g2000cwl.googlegro ups.com...
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Thanks...
Java is is a copy of c++. C++ has more features is faster. There is nothing
new in java you cannot do in C++.
Java sucks
John
multiple inheritance for example
Sascha Bohnenkamp wrote:
multiple inheritance for example
Yes, but you can implement multiple interfaces. So multiple
implementation inheritance can not be done, but multiple interface
inheritance can be accomplished in Java.
BillJosephson wrote:
Rolf Magnus wrote:
BillJosephson wrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Java has features that C++ doesn't have, and C++ has features that Java
doesn't have. If any, I'd call Java the subset, because quite some features
have been removed to make the language simpler.
Thanks much for the responses.
Hm, I'm surprised by this, given what other people have told me.
I'm not surprised that you are surprised. Some people have this
impression that Java is a super-language that has taken over the
software world.
I've been told that the Microsoft Office, OpenOffice, and Firefox are
written in Java.
Bruintje Beer wrote:
"BillJosephson" <bi***********@hotmail.comschreef in bericht
news:11**********************@51g2000cwl.googlegro ups.com...
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Thanks...
Java is is a copy of c++. C++ has more features is faster. There is nothing
new in java you cannot do in C++.
Java sucks
John
C++ "had" more feature, Java 1.5 added a lot... i.e. Gereics which are
their version of templates... But Java has features that C++ doesn't
have... not saying that you can't do it in C++, but its convienient in
Java... i.e. Serializable, Type Safe Enumerated class, garbage
collection is convienient... But I will admit it is slower, and I would
probably not implement a Server in Java (though this is being done with
success). But I wouldn't dismiss it off hand and say "java sucks".
bjeremy wrote:
Bruintje Beer wrote:
[snipped]
Please don't feed the trolls.
Best regards,
Tom
jeremy wrote:
C++ "had" more feature, Java 1.5 added a lot... i.e. Gereics which are
their version of templates...
I hope you're not seriously trying to claim that generics are
templates. All generics are is a wrapper around down-casts and up-casts
from generic Object types.
Josh McFarlane wrote:
jeremy wrote:
C++ "had" more feature, Java 1.5 added a lot... i.e. Gereics which are
their version of templates...
I hope you're not seriously trying to claim that generics are
templates. All generics are is a wrapper around down-casts and up-casts
from generic Object types.
No, I'm seriously trying to imply that they try and give you the same
functionaity of generic programming, not on how differently the two
language features are implemented.
bjeremy wrote:
No, I'm seriously trying to imply that they try and give you the same
functionaity of generic programming, not on how differently the two
language features are implemented.
Except that you can't actually use generics. You can use Objects, and
cast them to and fro as generic parameters, but god forbid you actually
try to store a generic.
Josh McFarlane wrote:
bjeremy wrote:
No, I'm seriously trying to imply that they try and give you the same
functionaity of generic programming, not on how differently the two
language features are implemented.
Except that you can't actually use generics. You can use Objects, and
cast them to and fro as generic parameters, but god forbid you actually
try to store a generic.
Fine noone likes Java Generics.. I get it... but you have to admit
Java's anonymous inner classes are way cool...
BillJosephson wrote:
Aside from the differences in parameter passing Erik mentioned, what
can C++ do that java is lacking?
1. Execute code at compile time thanks to C++'s Turing-complete type system.
2. Low-level access to data structure internals, so you have more control
over memory usage.
3. Write unsafe code that accesses raw memory locations.
4. Operator overloading.
Both C++ and Java lack lots of features found in other languages, of course.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
* Jon Harrop:
BillJosephson wrote:
>Aside from the differences in parameter passing Erik mentioned, what can C++ do that java is lacking?
1. Execute code at compile time thanks to C++'s Turing-complete type system.
2. Low-level access to data structure internals, so you have more control
over memory usage.
3. Write unsafe code that accesses raw memory locations.
4. Operator overloading.
Both C++ and Java lack lots of features found in other languages, of course.
Of course Java can do a lot of things that C++ can't in a reasonable way
(but one example, safe applets), but to the above list I'd add as most
important,
0. C++ can interface to (or be used to implement!) OS or other
API functions, and in general, assembler language.
For example, the virtual platform that Java code runs on is implemented
in C and/or C++; Java's platform /independence/ is directly implemented
in terms of C and C++ platform /availability/.
C++ is a combination of systems-programming language, application/system
glue language, and application language. Java is a pure application
language. In pure Java you're restricted to the virtual Java universe
(not that that's bad, it's useful e.g. for productivity, but it's a
restriction), while in C++ you're in a mostly infinite universe,
although one with certain barred areas (such as applets, unless you're
willing to use a technology like Microsoft's ActiveX controls).
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alf P. Steinbach wrote:
For example, the virtual platform that Java code runs on is implemented
in C and/or C++; Java's platform /independence/ is directly implemented
in terms of C and C++ platform /availability/.
In theory, you don't need C or C++ to implement Java.
C++ is a combination of systems-programming language, application/system
glue language, and application language. Java is a pure application
language. In pure Java you're restricted to the virtual Java universe
(not that that's bad, it's useful e.g. for productivity, but it's a
restriction), while in C++ you're in a mostly infinite universe,
"mostly infinite"? :-)
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Erik Wikström wrote:
Well, I don't know of any comparison but personally I'd say that C++ is
a superset of Java, way more powerful.
C++ doesn't even have garbage collection and it isn't cross platform.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Jon Harrop wrote:
Erik Wikström wrote:
>>Well, I don't know of any comparison but personally I'd say that C++ is a superset of Java, way more powerful.
C++ doesn't even have garbage collection
C++ neither wants nor requires garbage collection.
and it isn't cross platform.
Availability of compilers isn't a language feature.
--
Ian Collins.
Jon Harrop wrote:
Alf P. Steinbach wrote:
>For example, the virtual platform that Java code runs on is implemented in C and/or C++; Java's platform /independence/ is directly implemented in terms of C and C++ platform /availability/.
In theory, you don't need C or C++ to implement Java.
You mean we could use Fortran?
Or code the JVM in pure Java? That would assure universal portability. :-)
Bo Persson
Jon Harrop wrote:
Erik Wikström wrote:
>Well, I don't know of any comparison but personally I'd say that C++ is a superset of Java, way more powerful.
C++ doesn't even have garbage collection
You mean except for this one? http://www.hpl.hp.com/personal/Hans_Boehm/gc/
and it isn't cross platform.
Java isn't cross platform at all, it only runs on the JVM. To move Sun's
Open Source Java to a new target, you first have to port a C++ compiler.
Bo Persson
On 19 Jan 2007 06:31:03 -0800, BillJosephson <bi***********@hotmail.comwrote:
Want to do OOP. Does c++ have all the abilities of java, or is it some
subset?
Despite superficial similarities, Java and C++ are different languages.
Neither is a subset, even though Java used to be marketed as a
simplification of C++.
Solve a real-world problem well in Java, and solve it well in C++. Chances
are they solutions will both be good, but very different.
Key features are, IMHO, Java's garbage collected objects versus C++'s RAII
and almost cost-free small classes.
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org R'lyeh wgah'nagl fhtagn!
Jon Harrop skrev:
Erik Wikström wrote:
Well, I don't know of any comparison but personally I'd say that C++ is
a superset of Java, way more powerful.
C++ doesn't even have garbage collection and it isn't cross platform.
If anyone wants to have garbage collection with C++, they install a
garbage collector such as the Boehm one. Also, C++ is available on far
more platforms than Java. Apart from that I sort of agree with you.
/Peter
peter koch wrote:
If anyone wants to have garbage collection with C++, they install a
garbage collector such as the Boehm one.
Then they're still lacking safety.
Also, C++ is available on far
more platforms than Java. Apart from that I sort of agree with you.
IME, C++ programs require many changes to run on a different platform
whereas Java programs require none.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Bo Persson wrote:
>C++ doesn't even have garbage collection
You mean except for this one?
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
That isn't part of C++. Even with a pseudo-GC like Boehm's, you still lack
safety, efficiency (ok, so does Java), marshalling and many other features.
>and it isn't cross platform.
Java isn't cross platform at all, it only runs on the JVM.
Which has been ported to many platforms.
To move Sun's Open Source Java to a new target, you first have to port a
C++ compiler.
The most common platforms are existing targets.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Bo Persson wrote:
Jon Harrop wrote:
>In theory, you don't need C or C++ to implement Java.
You mean we could use Fortran?
Or assembler, BCPL...
Or code the JVM in pure Java? That would assure universal portability.
:-)
Most language implementations are bootstrapped.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Jon Harrop wrote:
Bo Persson wrote:
>>C++ doesn't even have garbage collection
You mean except for this one?
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
That isn't part of C++. Even with a pseudo-GC like Boehm's, you still lack
safety, efficiency (ok, so does Java), marshalling and many other features.
I see. If it's not part of the language specification, it doesn't exist.
Sorry, but that's another myth promoted through Java marketing. The fact
is that if you want GC in C++ it's available to you. But you're not
forced to use it. Marshalling has been done in C and C++ for a long
time. Java didn't invent it. Same thing for "many other features".
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Jon Harrop wrote:
peter koch wrote:
>If anyone wants to have garbage collection with C++, they install a garbage collector such as the Boehm one.
Then they're still lacking safety.
Again with the undefined terms. More Java marketing.
>Also, C++ is available on far more platforms than Java. Apart from that I sort of agree with you.
IME, C++ programs require many changes to run on a different platform
whereas Java programs require none.
Yup. Write once, run anywhere. Does anybody outside of Java's marketing
department actually believe that today? Even James Gosling qualified it:
"write once (carefully), run anywhere (mostly)."
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Jon Harrop wrote:
Bo Persson wrote:
>Jon Harrop wrote:
>>In theory, you don't need C or C++ to implement Java.
You mean we could use Fortran?
Or assembler, BCPL...
>Or code the JVM in pure Java? That would assure universal portability. :-)
Most language implementations are bootstrapped.
Once you have a C++ compiler that generates machine code for a
particular platform you're all set. Unlike Java, uou don't need to
install a separate runtime environment to get your application to run.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Pete Becker wrote:
I see. If it's not part of the language specification, it doesn't exist.
Sorry, but that's another myth promoted through Java marketing. The fact
is that if you want GC in C++ it's available to you. But you're not
forced to use it. Marshalling has been done in C and C++ for a long
time. Java didn't invent it. Same thing for "many other features".
This is about language features. All of those features come with Java. None
come with C++. Some can be retrofitted but will never work as well as a
system designed for them (e.g. GC).
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Pete Becker wrote:
Once you have a C++ compiler that generates machine code for a
particular platform you're all set. Unlike Java, uou don't need to
install a separate runtime environment to get your application to run.
True. Although I expect there are Java -standalone exe compilers out
there.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Jon Harrop wrote:
Pete Becker wrote:
>I see. If it's not part of the language specification, it doesn't exist. Sorry, but that's another myth promoted through Java marketing. The fact is that if you want GC in C++ it's available to you. But you're not forced to use it. Marshalling has been done in C and C++ for a long time. Java didn't invent it. Same thing for "many other features".
This is about language features. All of those features come with Java. None
come with C++.
I see. If it's not part of the language specification, it doesn't exist.
Sorry, but for people who write code for a living (unlike marketing
hacks), this is nonsense.
Some can be retrofitted but will never work as well as a
system designed for them (e.g. GC).
Do you have any actual evidence to support that sweeping claim?
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
On 2007-01-20 18:38, Jon Harrop wrote:
Pete Becker wrote:
>I see. If it's not part of the language specification, it doesn't exist. Sorry, but that's another myth promoted through Java marketing. The fact is that if you want GC in C++ it's available to you. But you're not forced to use it. Marshalling has been done in C and C++ for a long time. Java didn't invent it. Same thing for "many other features".
This is about language features. All of those features come with Java. None
come with C++. Some can be retrofitted but will never work as well as a
system designed for them (e.g. GC).
In that case I'd say Java loses much of it's winning points, the
extensive library for example. Without it Java would probably not be
near as big as it is today.
--
Erik Wikström
Jon Harrop wrote:
Pete Becker wrote:
>Once you have a C++ compiler that generates machine code for a particular platform you're all set. Unlike Java, uou don't need to install a separate runtime environment to get your application to run.
True. Although I expect there are Java -standalone exe compilers out
there.
Indeed. EDG has one, and it works with Dinkumware's Jcore library, most
of which I wrote. And, oddly enough, code that compiles just fine with
Sun's compiler sometimes doesn't compile with EDG's, except in
bug-compatible mode. So Java's claimed portability comes from using one
compiler only, and that one doesn't actually follow the published
specification.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Pete Becker wrote:
Jon Harrop wrote:
>peter koch wrote:
>>If anyone wants to have garbage collection with C++, they install a garbage collector such as the Boehm one.
Then they're still lacking safety.
Again with the undefined terms.
Safety = no dangling pointers, no buffer overruns, no segmentation faults...
More Java marketing.
You should read up on some other languages: OCaml, SML, Scheme, Lisp,
Haskell, even C#. They all offer these features and more. This is not
specific to Java.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Pete Becker wrote:
I see. If it's not part of the language specification, it doesn't exist.
The original question was specifically regarding the C++ and Java languages.
>Some can be retrofitted but will never work as well as a system designed for them (e.g. GC).
Do you have any actual evidence to support that sweeping claim?
Ask in the forums of any languages that support these features. Or just use
Google. Try porting some simple programs from other languages to C++...
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Erik Wikström wrote:
In that case I'd say Java loses much of it's winning points, the
extensive library for example. Without it Java would probably not be
near as big as it is today.
IMHO, Java only has a "big" library because it is ridiculously verbose. If
you look at the functionality provided by Java's standard library it is not
actually very extensive.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Pete Becker wrote:
Indeed. EDG has one, and it works with Dinkumware's Jcore library, most
of which I wrote. And, oddly enough, code that compiles just fine with
Sun's compiler sometimes doesn't compile with EDG's, except in
bug-compatible mode. So Java's claimed portability comes from using one
compiler only, and that one doesn't actually follow the published
specification.
Sure. Java is still more portable than C++ in practice.
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists http://www.ffconsultancy.com/product...ex.html?usenet
Jon Harrop wrote:
Pete Becker wrote:
>I see. If it's not part of the language specification, it doesn't exist.
The original question was specifically regarding the C++ and Java languages.
>>Some can be retrofitted but will never work as well as a system designed for them (e.g. GC).
Do you have any actual evidence to support that sweeping claim?
Ask in the forums of any languages that support these features.
You're the one making the claim, not me. The fact that you decline to
cite evidence supporting your claim makes it highly suspect.
Or just use
Google. Try porting some simple programs from other languages to C++...
Huh? How in the world does porting some simple program from some other
language to C++ show that some things "will never work as well as a
system designed for them"? At best, it might show that some things are
harder in C++ now. But "never" is an awfully long time.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Jon Harrop wrote:
Pete Becker wrote:
>Jon Harrop wrote:
>>peter koch wrote: If anyone wants to have garbage collection with C++, they install a garbage collector such as the Boehm one. Then they're still lacking safety.
Again with the undefined terms.
Safety = no dangling pointers, no buffer overruns, no segmentation faults...
Then Java isn't safe. After all, it has an exception named
NullPointerException. And it does, indeed, run into segmentation faults.
Yes, that's usually caused by JNI code, but that doesn't change the fact
that these things do occur, despite marketing hype to the contrary.
>More Java marketing.
You should read up on some other languages: OCaml, SML, Scheme, Lisp,
Haskell, even C#. They all offer these features and more. This is not
specific to Java.
Thank you for your condescension. Nevertheless, using undefined terms is
a classic technique for people who don't have facts to support there
positions. And vague suggestions to look at other languages does not
magically produce definitions.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Jon Harrop wrote:
Pete Becker wrote:
>Indeed. EDG has one, and it works with Dinkumware's Jcore library, most of which I wrote. And, oddly enough, code that compiles just fine with Sun's compiler sometimes doesn't compile with EDG's, except in bug-compatible mode. So Java's claimed portability comes from using one compiler only, and that one doesn't actually follow the published specification.
Sure. Java is still more portable than C++ in practice.
Sigh. You've snipped the context here, which was about having to install
a runtime environment to get portability.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Jon Harrop wrote:
Pete Becker wrote:
>>I see. If it's not part of the language specification, it doesn't exist. Sorry, but that's another myth promoted through Java marketing. The fact is that if you want GC in C++ it's available to you. But you're not forced to use it. Marshalling has been done in C and C++ for a long time. Java didn't invent it. Same thing for "many other features".
This is about language features. All of those features come with Java. None
come with C++. Some can be retrofitted but will never work as well as a
system designed for them (e.g. GC).
C++ doesn't require GC, Java does. So how can it be described as a
beneficial feature?
--
Ian Collins.
Ian Collins escreveu:
Jon Harrop wrote:
>Pete Becker wrote:
>>I see. If it's not part of the language specification, it doesn't exist. Sorry, but that's another myth promoted through Java marketing. The fact is that if you want GC in C++ it's available to you. But you're not forced to use it. Marshalling has been done in C and C++ for a long time. Java didn't invent it. Same thing for "many other features".
This is about language features. All of those features come with Java. None come with C++. Some can be retrofitted but will never work as well as a system designed for them (e.g. GC).
C++ doesn't require GC, Java does. So how can it be described as a
beneficial feature?
To answer that you need to question yourself if this features allow
easier programming, safely, less error prone.
Cesar Rabak wrote:
>C++ doesn't require GC, Java does. So how can it be described as a beneficial feature?
To answer that you need to question yourself if this features
allow easier programming, safely, less error prone.
I'd answer: finalizers vs. destructors.
Nuf' said, as far as I'm concerned.
Cheers,
--
IR This discussion thread is closed Replies have been disabled for this discussion. |