Search code examples
c#design-patternsdeclarative

Are Declarative and Imperative patterns kind of design patterns?


I read this sentence

"C# supports patterns for purity"

...in the book C# 8.0 in a Nutshell from O'Reilly. It continued that

"Core to functional programming is avoiding the use of variables whose values change, in favor of declarative patterns."

I tried to understand what is declarative patterns. But I couldn't find the declarative pattern as any subcategories of design patterns.

Can anyone explain to me if the declarative pattern is different from design patterns such as Behavioral, Creational, and Structural?


Solution

  • Programming Paradigm: There are mainly two being, imperative and declarative, where you'll find functional, logic and mathematical programming under declarative programming paradigm. OOP and procedural programming are under imperative programming paradigm. Remember, this is just basic essence and its not explicit.

    Design Patterns: A design pattern is a useful abstraction that can be implemented in any language. It is a "pattern" for doing things, moreover reusable solutions,which we categories as Behavioral, Creational, and Structural.