dimanche 12 août 2018

To what extent modern C++ obviate the need for design patterns?

The Design Patterns book by GoF which came out in 1994 was written with C++ like languages in mind and many of the code examples were given in C++. Programmers of other languages felt that their languages did not need these 23 design patterns as those languages had features that made many of the patterns redundant.

From Wikipedia:

A primary criticism of Design Patterns is that its patterns are simply workarounds for missing features in C++, replacing elegant abstract features with lengthy concrete patterns, essentially becoming a "human compiler" or "generating by hand the expansions of some macro". Peter Norvig demonstrates that 16 out of the 23 patterns in Design Patterns are simplified or eliminated (via direct language support) in Lisp or Dylan.

C++ has undergone five revisions since the Design Patterns book came out (in 98, 03, 11, 14, 17). So the question is, to what extent does modern C++ simplify or eliminate the need for these 23 design patterns?

It would be good to list the Design Pattern along with the C++ language feature which eliminates or simplifies the need for that Pattern.

Aucun commentaire:

Enregistrer un commentaire