Author: Gareth McCaughan
Date: 15:01:16 12/11/01
Go up one level in this thread
On December 11, 2001 at 17:25:26, Roy Eassa wrote: >On December 11, 2001 at 13:42:56, David Hanley wrote: > >>On December 11, 2001 at 12:56:50, David Rasmussen wrote: >> >>>On December 11, 2001 at 11:47:19, David Hanley wrote: >>> >> >>>>Yes. C++ is assembler with objects. >>> >>>Not at all. Templates and generic programming alone is a revolution, that is >>>unique to C++, >> >>No, both were around long before C++, and i'd even say that the c++ >>implementations of them are quite poor. > > > I was under the impression that templates were a new programming construct > with C++ (i.e., they did not exist in any language before they were > introduced into C++). Am I incorrect? Templates as such are new with C++. Much of what they do can be done better by other means that have existed for ages. What templates give you is the ability to generate code at compile time on the basis of simple pattern matching that can make use of the declared types of objects. Apart from the "declared types of objects" thing, the same facilities are provided by (e.g.) Common Lisp's macros system, only less painfully. The type-dispatching thing is quite important to C++ templates, though, and obviously you couldn't have that in a dynamically typed language. (You could have something like it, by exposing the compiler's type inferencing mechanism to the macro system. CL doesn't provide that.) I don't know of any other system that provided the exact same function that templates do, before templates. So yes, templates are new. It would be misleading to claim that (e.g.) "generative programming" or "generic programming" -- two buzzwords often associated with templates -- are new. -- g
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.