Declarative Programming Definition & Meaning

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
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

Huge List Of Texting and Online Chat Abbreviations

From A3 to ZZZ we list 1,559 text message and online chat abbreviations to help you translate and understand today's texting lingo. Includes Top...

How To Create A Desktop Shortcut To A Website

This Webopedia guide will show you how to create a desktop shortcut to a website using Firefox, Chrome or Internet Explorer (IE). Creating a desktop...

The History Of Windows Operating Systems

Microsoft Windows is a family of operating systems. We look at the history of Microsoft's Windows operating systems (Windows OS) from 1985 to present...

Hotmail [Outlook] Email Accounts

  By Vangie Beal Hotmail is one of the first public webmail services that can be accessed from any web browser. Prior to Hotmail and its...

Supply Chain Definition &...

A supply chain is a network between an organization and its suppliers to...

Relational Database Definition &...

A relational database stores and connects data in tables and columns, emphasizing the...

Common Business-Oriented Language (COBOL)...

What is COBOL? COBOL stands for Common Business-Oriented Language. It is a 60-year-old programming...