3 ms·
I realize i made an anachronical mistake. However the Design Patterns book and the 'design patterns' mindset is most popular with Java developers. Sorry but I
by flavio81 9y ago
I realize i made an anachronical mistake. However the Design Patterns book and the 'design patterns' mindset is most popular with Java developers.
Sorry but I do stand on my criticism of Design Patterns as applied today.
> The language most of the examples are written in, C++, does allow multiple inheritance and metaprogramming,
You're being very generous with C++ if you consider it does allow metaprogramming. It does not, if we compare it with the languages that make good use of metaprogramming: Lisp, Scheme, Racket, and now Julia.
- chii 9y agoYou cant move the goal post! C++ template is meta programming, as it's Turing complete. It's ugly and messy, but usable enough.
- flavio81 9y agoThere is a ton of usability, scope, and power difference between the metaprogramming of C++ templates versus the metaprogramming of the Lisp family of languages (and Julia), which is what is usually considered as metaprogramming in the practical sense, languages that are arguably designed around metaprogramming as a fundamental feature. Just as assembly language is also turing complete, but there is also a ton of usability difference between it versus C/C++, in favor of C/C++ and with little performance penalty.
- kazinator 9y agoMore importantly than Turing complete, assembly language has complete access to the machine resources and data representations. A language can be Turing Complete, yet do only pure calculation plus I/O strictly in Roman numerals on two predefined streams. Good luck decoding a JPEG with that, right?
- kazinator 9y agoC++ template meta programming isn't Turing complete in a way that is useful. Turing Complete means that you can calculate any partial recursive function (given some suitable input encoding). For instance, in pure Lambda Calculus that has only functional terms (no numbers), we an make integers out of function using "Church numerals" and then calculate functions over these numbers. No amount of such calculation will produce an integer object, though. Similarly C++ template cannot calculate any C++ syntax whatsoever, in spite of Turing Completeness. You get template functions and template classes; that's it.