#Programming_paradigms : Declarative versus Imperative
#Declarative
All about relations.
Does not state the order in which operations execute.
Focuses on what the program should accomplish without specifying how the program should achieve the result.
Expresses the logic of a computation without describing its control flow.
Common declarative languages include those of database query languages (e.g. #SQL, #XQuery), regular expressions (#Regex), logic programming, functional programming, and configuration management systems.
e.g. #Haskell, #Kanren (a dialect of #Scheme), #Prolog, #Wolfram_Language
#Imperative
Uses statements that change a program's state.
1. they state the order in which operations occur, with constructs that explicitly control that order
Allows side effects, in which state can be modified within one unit of code, and then read inside a different unit of code.
Imperative programming focuses on describing how a program operates.
an imperative program consists of commands for the computer to perform.
Many imperative programming languages (such as #Fortran, #BASIC, and #C) are abstractions of assembly language.
#Declarative
All about relations.
Does not state the order in which operations execute.
Focuses on what the program should accomplish without specifying how the program should achieve the result.
Expresses the logic of a computation without describing its control flow.
Common declarative languages include those of database query languages (e.g. #SQL, #XQuery), regular expressions (#Regex), logic programming, functional programming, and configuration management systems.
e.g. #Haskell, #Kanren (a dialect of #Scheme), #Prolog, #Wolfram_Language
#Imperative
Uses statements that change a program's state.
1. they state the order in which operations occur, with constructs that explicitly control that order
Allows side effects, in which state can be modified within one unit of code, and then read inside a different unit of code.
Imperative programming focuses on describing how a program operates.
an imperative program consists of commands for the computer to perform.
Many imperative programming languages (such as #Fortran, #BASIC, and #C) are abstractions of assembly language.