Tanton Gibbs
Posts: 20
Nickname: tanton
Registered: Aug, 2005
|
|
Re: As Simple As Possible?
|
Posted: Aug 17, 2005 5:52 PM
|
|
I think templates cause a headache in C++ because we are using the same language feature to address two different paradigms. Generic Programming is programming by static interfaces. This is the traditional use of templates as witnessed by Ada and the new Generics in Java. The other paradigm is Generative programming. People often relate the two because of the C++ template connection, but they are two different paradigms. For instance, Template Haskell uses a completely different mechanism for Generative Programming, one that is more orthogonal with the language. C++ Generative Programming with templates was more on accident than by intention; therefore, it is fraught with peril and exception. If the language would separate out its Generic programming facilities from its Generative programming facilities, I believe it would be a much cleaner and simpler language. Note that this also explains why languages with Generics (e.g., Java) are looked upon as less powerful than C++. This is because they only support Generic programming, not Generative. However, it could be that when they do add in Generative support, they do so in a much cleaner manner; giving a more powerful langauge that is simple as well.
|
|