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
Jenna Phipps is a writer for Webopedia.com, Enterprise Storage Forum, and CIO Insight. She covers data storage systems and data management, information technology security, and enterprise software solutions.

Related Articles

Product Manager

A product manager is someone involved in all areas of production, including setting strategies; developing products; and working with relevant project team members, such...

Kintone

Companies looking for a business process management or customer relationship management (CRM) tool may wonder if Kintone is the right choice. In this Kintone...

Special Character

A special character is one that is not considered a number or letter. Symbols, accent marks, and punctuation marks are considered special characters. Similarly,...

HR Recruitment Software

HR recruitment software helps organizations find, recruit and hire the best job candidates.

Product Manager

A product manager is someone involved in all areas of production, including setting...

Kintone

Companies looking for a business process management or customer relationship management (CRM) tool...

Geotargeting

Geotargeting is a method of delivering data or content to users based on...