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

Human Resources Management System

A Human Resources Management System (HRMS) is a software application that supports many functions of a company's Human Resources department, including benefits administration, payroll,...

How To Defend Yourself Against Identity Theft

Almost every worldwide government agency responsible for identity theft issues will tell you the same thing: The first step to fighting identity theft is...

Infographic

An infographic is a visual representation of information or data. It combines the words information and graphic and includes a collection of imagery, charts,...

Phishing

What is phishing? Phishing is a type of cybercrime in which victims are contacted by email, telephone, or text message by an attacker posing as...

ScalaHosting

ScalaHosting is a leading managed hosting provider that offers secure, scalable, and affordable...

HRIS

Human resources information system (HRIS) solutions help businesses manage multiple facets of their...

Best Managed Service Providers...

In today's business world, managed services are more critical than ever. They can...