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.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.
Get the Free Newsletter
Subscribe to Daily Tech Insider for top news, trends & analysis
This email address is invalid.

Related Articles

Embedded Analytics

Embedded analytics brings self-service business intelligence to everyday application users.

HRIS

Human resources information system (HRIS) solutions help businesses manage multiple facets of their workforce operations. They provide a central platform for human resources professionals...

Complete List of Cybersecurity Acronyms

Cybersecurity news and best practices are full of acronyms and abbreviations. Without understanding what each one means, it's difficult to comprehend the significance of...

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

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