-4

It seems that design patterns are actually linked to some C++ or Java object models (e.g. they might not fit to Ocaml objects, or to Common Lisp Object System). Or at least tied to a specific programming language (e.g. Common Lisp and C probably have different design patterns?) or some application (e.g. Elephant in Common Lisp).

Are design patterns different of coding rules? (e.g. MISRA-C)

It seems that design patterns make no sense in functional languages (e.g. a book on Haskell don't even mention them).

It seems that compilers like GCC or Ocaml don't follow design patterns. Of course, they do share a lot of concepts (abstract syntax trees, front-end/middle-end/back-end).

It seems that the Linux kernel follows some design patterns.

It seems that large open source systems (e.g. PostGreSQL or the Linux kernel) don't even claim to follow (all, or most) design patterns.

For what kind of software are design patterns useful? Example in open source projects are welcome!

Are there any software tools enhancing/verifying design patterns (preferably open source tools that I could test on a Linux desktop)?

Should an expert system shell project (like RefPerSys) define design patterns? ClipsRules don't seem to mention them.

It seems that operating system kernels don't follow all the same design patterns.... (there are large differences between Linux and FreeBSD, even if many concepts - drivers, processes, ... are similar).

NB. Ocaml and JavaScript seems on the opposite sides of design patterns.... Ocaml favoring strict compile-time typing, JavaScript favoring dynamic runtime typing.

Foster's book on designing and building parallel programs don't mention design patterns.

Sejnowski's book on the Deep Learning Revolution don't mention design patterns.

Zellers' book on why programs fail is the only book that mention design patterns

Fowler's book on domain specific languages mention design patterns different of other books.

Basile Starynkevitch
  • 32,434
  • 6
  • 84
  • 125
  • Why the downvote? – Basile Starynkevitch Dec 11 '21 at 14:49
  • 4
    Design Patterns are names for known-working solutions to recurring problems. What makes you think there are no recurring problems in Haskell or that there are no known good solutions to problems in Haskell? E.g. I would argue that "monad transformer stack" is a Haskell design pattern. – Jörg W Mittag Dec 11 '21 at 14:51
  • Because the book I have about Haskell (ISBN 0-201-34275-8) don't even mention design patterns.... I also saw no mention of design patterns in GCC (to which I did contribute in the past) or its [mailing lists](https://gcc.gnu.org/lists.html). I also saw no design patterns inside the source code of [Ocaml](https://ocaml.org/) – Basile Starynkevitch Dec 11 '21 at 14:52
  • 2
    GCC is older than the term *design pattern*, but the fact that when GCC was designed, the term had not yet been coined does not necessarily mean that there are no recurring problems with good solutions. For example, I would consider "Shared Intermediate Language" to be a Compiler Design Pattern for solving the m×n problem of languages×platforms, and that Pattern is certainly used in GCC and much more aggressively in LLVM. – Jörg W Mittag Dec 11 '21 at 15:02
  • Yes, called GIMPLE in GCC. But that pattern seems specific to compilers. Does it make sense in database servers? – Basile Starynkevitch Dec 11 '21 at 15:03
  • Actually, I learned programming much before design patterns existed.... And most of the paper books I have about programming don't even mention them. Including books bought a few months or years ago -and I am not a native English speaker (but French). Is metaprogramming a design pattern? – Basile Starynkevitch Dec 11 '21 at 15:05
  • 5
    Basile, your questions are always fascinating but meandering. Here, you link to so much stuff that is irrelevant for your main question (design patterns in functional languages). Of course a book about deep learning won't discuss software design patterns. I feel like even just the [Wikipedia article](https://en.wikipedia.org/wiki/Software_design_pattern) would have provided helpful orientation. “Design patterns” are also connected to the 90s OOP hype, so it should be understandable that non-OOP and non-90s era languages are not frequently viewed through the patterns lense. – amon Dec 11 '21 at 21:38
  • "Actually, I learned programming much before design patterns existed." - no, you learned programming before *the term* "design pattern" was becoming popular in software engineering, but not before design patterns existed. At the time we were using assembler, a popular design pattern was "loop" or "subroutine". Today, we don't need these design patterns any more in any sane higher language, because these things are provided by those languages. – Doc Brown Dec 12 '21 at 20:38
  • ... note also systems don't "follow" design patterns. They make use of them, some more frequently, some less frequently. But in any sufficiently large system one will find recurring problems (which also appear in other systems), which cannot be solved directly by an atomic language construct, but may be solved by a recurring solution. – Doc Brown Dec 12 '21 at 20:44
  • ... a coding standard like MISRA-C, however, consists mainly of rules which restrict the usage of certain language elements, I don't know all the MISRA rules, but the ones I have seen so far are not solutions to recurring problems, so no design patterns. – Doc Brown Dec 12 '21 at 20:57

1 Answers1

2

From a simplistic view one might consider that although the term design patterns is not mentioned it cannot not to exist in software development since its definition, see Software design pattern Wikipedia page, is:

In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design.

Thinking in terms of human behaviour reflexes being developed by commonly occurring problems could it be that they are design patterns?

Psychologically too one could talk about design patterns entitled by the filed's studies, see Einstellung effect just to mention one.

What I'm trying to say is that various terms refer to one common way of responding to repeated situations, I think.

lennon310
  • 3,132
  • 6
  • 16
  • 33
user406532
  • 21
  • 1