Declarative programming: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
m Citation: Fixed issue
Tags: Reverted Visual edit Mobile edit Mobile web edit Advanced mobile edit
Line 5:
In [[computer science]], '''declarative programming''' is a [[programming paradigm]]—a style of building the structure and elements of computer programs—that expresses the logic of a [[computation]] without describing its [[control flow]].<ref>{{citation|last=Lloyd|first=J.W.|title=Practical Advantages of Declarative Programming}}</ref>
 
Many languages that apply this style attempt to minimize or eliminate [[side effect (computer science)|side effects]] by describing ''what'' the program must accomplish in terms of the [[___domain knowledge|problem ___domain]], rather than describing ''how'' to accomplish it as a sequence of the programming [[language primitive]]s<ref name="FOLDOC 2004">{{cite web |date=May 17, 2004 |title=FOLDOC: |url=declarative |url-status=unlanguage |archive-url=526/https://foldoc.org/declarative+language |url-status= |archive-url= |archive-date= |access-date=7 September 7, 2023 |website=FOLDOC}}</ref> (the ''how'' being left up to the language's [[programming language implementation|implementation]]). This is in contrast with [[imperative programming]], which implements [[algorithm]]s in explicit steps.<ref name="Sebesta 2016">{{cite book | last=Sebesta | first=Robert | title=Concepts of programming languages | publisher=Pearson | publication-place=Boston | year=2016 | isbn=978-0-13-394302-3 | oclc=896687896}}</ref><ref>{{Cite web |date=2021-05-21 |title=Imperative programming: Overview of the oldest programming paradigm |url=https://www.ionos.com/digitalguide/websites/web-development/imperative-programming/ |access-date=2023-05-23 |website=IONOS Digital Guide |language=en-US |archive-date=2022-05-03 |archive-url=https://web.archive.org/web/20220503083342/https://www.ionos.com/digitalguide/websites/web-development/imperative-programming/ |url-status=live }}</ref>
 
Declarative programming often considers [[program (machine)|programs]] as theories of a [[Mathematical_logic#Formal_logical_systems|formal logic]], and computations as deductions in that logic space. Declarative programming may greatly simplify writing [[parallel computing|parallel programs]].<ref>{{cite web|url=http://www.cse.unsw.edu.au/~pls/damp09/ |title=DAMP 2009: Workshop on Declarative Aspects of Multicore Programming |publisher=Cse.unsw.edu.au |date=20 January 2009 |access-date=15 August 2013 |archive-url=https://web.archive.org/web/20130913162703/http://www.cse.unsw.edu.au/~pls/damp09/ |archive-date=13 September 2013 |url-status=dead}}</ref>