Declarative Programming

Declarative programming is a programming language paradigm that is based on logic and focuses more on what a program should accomplish rather than detailing how that should be accomplished. This directly contrasts with imperative programming, which describes in great detail every step of a programming command or function. A declarative programming language will have a few underlying guidelines based on logic so that the program can operate, but it does not give specific commands for each step. Instead, it receives instructions for what must be accomplished (the end result of a section of code, for example), and the program follows a logical progression to complete that task.

Declarative programming belongs to domain-specific languages (DSL), not general-purpose ones. Domain-specific languages only apply to one particular domain: HTML, for example, is a DSL; it only applies to HTML code for web pages. SQL (Structured Query Language, for database management) is another. This makes it possible for declarative programs to logically complete a task – because the program applies to one specific domain, it doesn’t need to be particularly flexible or changeable.

Declarative programming vs. imperative programming

Imperative programming applies to languages like Java and C, which require detailed instructions for each piece of code. For something to be changed, it must be programmed in some way. This allows developers to make changes to the program when needed. Declarative programming is not as flexible.

However, declarative programming is easier to read, and it’s less cluttered. It can be difficult for developers to grasp because the language doesn’t explain how a process was completed, but it’s a useful paradigm for programs that belong to one specific domain that has a particular logic.






Jenna Phipps
Jenna Phipps is a contributor for websites such as Webopedia.com and Enterprise Storage Forum. She writes about information technology security, networking, and data storage. Jenna lives in Nashville, TN.

Top Articles

The Complete List of 1500+ Common Text Abbreviations & Acronyms

Text Abbreviations reviewed by Web Webster   From A3 to ZZZ we list 1,559 SMS, online chat, and text abbreviations to help you translate and understand...

Windows Operating System History & Versions

The Windows operating system (Windows OS) refers to a family of operating systems developed by Microsoft Corporation. We look at the history of Windows...

How to Create a Website Shortcut on Your Desktop

Website Shortcut on Your Desktop reviewed by Web Webster   This Webopedia guide will show you how to create a website shortcut on your desktop using...

Generations of Computers (1st to 5th)

Reviewed by Web Webster Learn about each of the 5 generations of computers and major technology developments that have led to the computing devices that...

Telecommunication

Telecommunication refers to telephony and cellular network technology. However, the broader definition includes...

Spoofing

What is spoofing? As it pertains to cybersecurity, spoofing is when a person disguises...

How to Indent in...

Microsoft Word is a graphical word...