Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25941

Re: Java vs C++

Date 2011-02-08 10:26 +1100
From Esmond Pitt <esmond.pitt@bigpond.com>
Newsgroups comp.lang.java.programmer
Subject Re: Java vs C++
References (10 earlier) <iink6l$87t$1@lust.ihug.co.nz> <4d4f56ac$0$23758$14726298@news.sunsite.dk> <iinmra$9er$7@lust.ihug.co.nz> <4d4f61fb$0$23756$14726298@news.sunsite.dk> <iio27n$g2f$2@lust.ihug.co.nz>
Message-ID <4d507f8a$0$32793$c30e37c6@exi-reader.telstra.net> (permalink)

Show all headers | View raw


On 7/02/2011 5:07 PM, Lawrence D'Oliveiro wrote:
> The Java designers wanted everything that C++ templates offered.

It should be obvious from the design that they wanted a great deal more 
than that. They wanted a coherent type system for a start, which C++ 
templates don't have, and they wanted compile-time safety, which 
*requires* a coherent type system. That's what all the T super X and T 
extends Y stuff is for - so the compiler can do type algebra. None of 
this appears in C++ whatsoever.

It is totally and utterly wrong misleading to think of Java Generics and 
C++ templates as similar. They are really polar opposites. C++ templates 
generate new types. Java Generics restrict existing types.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:08 +1300
  Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 21:19 -0500
    Re: Java vs C++ Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-02-09 01:07 +0800
    Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 19:44 -0500
    Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:53 +1300
      Re: Java vs C++ Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-02-08 10:25 +0000
        Re: Java vs C++ Lew <noone@lewscanon.com> - 2011-02-08 07:53 -0500
      Re: Java vs C++ Esmond Pitt <esmond.pitt@bigpond.com> - 2011-02-08 10:26 +1100
        Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-08 16:17 +1300
          Re: Java vs C++ Esmond Pitt <esmond.pitt@bigpond.com> - 2011-02-08 16:51 +1100
      Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 22:06 -0500
      Re: Java vs C++ "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-06 22:42 -0800
      Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-07 21:20 -0500
      Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 22:07 -0500
        Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 19:07 +1300

csiph-web