Author: Daniel Clausen
Date: 10:42:06 03/27/02
Go up one level in this thread
On March 27, 2002 at 12:59:53, Roy Eassa wrote:
>On March 27, 2002 at 12:58:35, Daniel Clausen wrote:
>
>>On March 27, 2002 at 12:22:13, Frank Schneider wrote:
>>
>>[snipped completely out of context]
>>
>>>An advantage of c++ is that you can use templates.
>>
>>Go and post that in a Java, ObjectiveC or SmallTalk forum. ;)
>>
>>Sargon
>
>
>Could you summarize what objections they might have to templates?
Basically, they consider templates as better macros and something you have to
use since C++ doesn't have a base class 'Object' provided by the language
framework.
Note that in Java every class (directly or indirectly) derives from the base
'Object'. Therefore it's possible to provide i.e. container classes (like lists,
arrays, hashtables etc) which take an object, whereas in C++ you have to use
templates for generic container classes. (among other things) Of course you have
better type-safety in C++ then.. On the other hand, Java has a more enhanced
run-time system etc to 'implement' type-safety on run-time again.
{even more off-topic now}
When comparing languages like Java and C++ (and others) it's important to see
the whole picture. Sadly, most people (of both sides!) just pick something and
bash on it, which is just silly. Ie a C++ programmer saying 'Java is crap
because it doesn't have templates. Therefore you can't even provide generic
container classes'. Or a Java programmer saying 'C++ is crap because it doesn't
even have a garbage-collector. You end up using more and more memory w/o every
releasing it!
Sorry, I got a bit distracted I guess. ;) But I witnessed many 'non-scientific
discussions' about these matters already, so I sometime get carried away. :)
Sargon
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.