Re: C++ is complicated
Juha Nieminen <nospam@thanks.invalid> writes:
community in general that OOP and especially inheritance is not, after
You have to tell between inheritance of interfaces and of
implementations. Inheritance of interfaces is great. To
implement, sometimes delegation might be better.
In the last decade the paradigms have shifted more towards
dynamic programming. Dynamic code/object generation (at compile
time or at runtime), dynamic creation of first-class objects
(including first-class functions), runtime type information
(which allows things like reflection), etc. Template
metaprogramming can be considered a subset of this.
This sounds strange too me. Template metaprogramming is
exactly the opposite. It is static programming - template
instantiation is happening at compile time. That's why the
afficinados are fond of it: It does not consume runtime.
?dynamic? means ?at runtime?. Templates are static in
comparison to OOP, which means run-time polymorphism
(late binding while templates are early binding).
Smalltalk/OOP: Bind everything as late as possible.
template metaprogramming: ... as early as possible.
Also there has been a clear shift towards a more functional
approach, inspired by lambda calculus.
Object-oriented programming languages (Smalltalk
and Lisp) always included functional sublanguages.