Questions tagged [declarative-programming]

A non-imperative style of building the structure and elements of computer programs that is concerned with what the program does over how it does it. Dealing with Query Languages, Reg Ex, logic, functionality and config systems.

Filter by
Sorted by
Tagged with
16 votes
7 answers
8k views

Is declarative programming just imperative programming 'under the hood'?

From my understanding, in declarative programming, programmer only need to define the end result, but not how to compute it. But for execute that said function, the function must be pre-defined by the ...
Loc's user avatar
  • 187
3 votes
5 answers
868 views

Is assignment declarative or imperative?

On Wikipedia, the article Programming paradigms defines declarative as a paradigm in which the programmer merely declares properties of the desired result, but not how to compute it; imperative as a ...
Géry Ogam's user avatar
14 votes
6 answers
3k views

Is "Low Code" declarative by default?

Something that has really be getting under my skin recently is that Salesforce uses the term "Declarative Development" to mean "Low Code" or "visual code". For example, this article explains the ...
NSjonas's user avatar
  • 267
3 votes
3 answers
232 views

Precisely define "what to solve" and "how to solve" corollary in functional and imperative programming respectively

I am not sure if I ever clearly understood standard corollary "what to solve" and "how to solve" used to point out difference between functional (declarative) and imperative programming paradigm ...
rahulaga-msft's user avatar
-1 votes
2 answers
167 views

Are executable requirements the most advanced form of declarative code?

The more declarative code is, the less explicit technical details it contains and the closer it gets to requirements expressed in domain language. In the extreme case, there is no more difference ...
Frank Puffer's user avatar
  • 6,429
11 votes
3 answers
4k views

Do functional programming languages disallow side effects?

According to Wikipedia, Functional programming languages, that are Declarative, they disallow side effects. Declarative programming in general, attempts to minimize or eliminate side effects. Also, ...
codebot's user avatar
  • 221
1 vote
1 answer
245 views

Is there an EBNF form for Inform 7

I'm trying to learn the language Inform 7 and its very odd programming model. Unfortunately I'm finding it hard to get my head around it because the language reads so much like natural English. I ...
Racheet's user avatar
  • 447
7 votes
1 answer
376 views

Why does FSharpLint suggest, "In F# code, use 'e1 || e2' instead of 'e1 or e2'"

If I write the expression, if not (expr1 or expr2) then value I get the following warning from FSharpLint, In F# code, use 'e1 || e2' instead of 'e1 or e2'. Why is using || preferred over using or? ...
pluralMonad's user avatar
1 vote
2 answers
243 views

Can a purely declarative language cause runtime exceptions?

Let us consider a purely declarative language such as SQL, XQuery, or a logic language like Prolog, or a purely functional language without variable mutability. Considering that the interpreter or ...
csblo's user avatar
  • 239
3 votes
3 answers
566 views

Declarative programming for deterministic real time control

Let's say you want control a motor in real time. Normally you would use a microcontroller or PC with e.g. c-programming language. So you would use an imperative approach. You tell the microcontroller ...
CPA's user avatar
  • 183
6 votes
2 answers
4k views

Is declarative programming overrated? [closed]

I've been programming for years with primarily-imperative languages (C++, C#, javascript, python), but have recently experimented with some functional langauges (Lisp, Haskell) and was excited to try ...
QuadrupleA's user avatar
1 vote
2 answers
448 views

Declarative parser for JSON and DOM

I am parsing many JSONs and DOMs in PHP. The problem is that the my knowledge about the structure of the JSON/DOM is mixed with code. For example, suppose that I have few sources of first and last ...
Mateusz Drost's user avatar
18 votes
5 answers
7k views

What makes functional programming languages declarative as opposed to Imperative?

On many articles, describing the benefits of functional programming, I have seen functional programming languages, such as Haskell, ML, Scala or Clojure, referred to as "declarative languages" ...
ALXGTV's user avatar
  • 1,495
3 votes
2 answers
997 views

How to infer the result of a query?

To understand what a query does, I have always thought the following is the procedure on evaluating a query: Form the table as specified in the FROM clause. Pick the rows from that table as specified ...
Utku's user avatar
  • 1,922
25 votes
9 answers
13k views

The dream of declarative programming [closed]

Why hasn't the dream of declarative programming been realized? What are some concrete obstacles getting in the way? For a simple example why can't I say sort(A) is defined by sort(A) in perm(A) &&...
user avatar
2 votes
2 answers
737 views

How are declarative languages executed by a computer?

I'm getting introduced to declarative languages and am beginning to love them. In particular Haskell, a functional language, is very expressive, easy to debug. But my question has to do with execution....
TV Mohini's user avatar
  • 181
2 votes
1 answer
220 views

Declarative caching on Collections

I am interested in using Spring's Cache Abstraction on a module that I am working with but all data operations are on collections to avoid multiple datasource invocations, so I am not sure I have a ...
smp7d's user avatar
  • 4,221
1 vote
1 answer
1k views

Mixing declarative & imperative code (Implicit 'unit tests' ?) [closed]

Well I'm no expert, but as a student, I'm curious about languages and their design patterns / goals. I'd like to know, whether there are any points I miss in the following examples, and why ...
kdani's user avatar
  • 121
3 votes
1 answer
127 views

In a declarative language, specifically in the context of modelling, can we make a clear distinction between code and data?

For declarative languages, specifically (but not limited to) in the field of modelling, it's not obvious to me whether code can be considered to be separate from data. This line of reasoning may only ...
Mike Vella's user avatar
29 votes
3 answers
15k views

Is SQL declarative?

I ask because so many of the questions I see in SQL amount to: "This is slow. How do I speed it up"? Or are tutorials stating "Do this this way and not that way as it's faster". It seems to me that a ...
Paddy3118's user avatar
  • 617
2 votes
1 answer
1k views

Is Clojure a 3GL or a 4GL?

A bit of background (in case I'm mistaken)... I think I understand that (it's an oversimplification): manually entering codes into memory (or on a punchcard) is "first generation language" using ...
Cedric Martin's user avatar
4 votes
3 answers
595 views

How could you reconcile declarative database development and non-trivial data 'motions'?

Coming back to SQL Server after several years away, I find the Visual Studio Database projects (and now SSDT) very exciting, as they are aiming to offer a way to develop databases declaratively, ...
Benjol's user avatar
  • 3,727
5 votes
7 answers
1k views

How to better start learning programming - with imperative or declarative languages? [closed]

Someone is interested in learning to program. What language paradigm should I recomend him - imperative or declarative? And what programming language should he start with? I think that declarative ...
user712092's user avatar
  • 1,412
1 vote
1 answer
207 views

Declarative input language strategies [closed]

I need to develop a simple declarative language to drive an application. I have various computational modules, some of them depending on other modules which also need setup. The problem is that I don'...
Stefano Borini's user avatar
13 votes
4 answers
1k views

What are some good practices when trying to teach declarative programming to imperative programmers?

I offered to do a little bit training in F# at my company and they seemed to show some interest. They are generally VB6 and C# programmers who don't follow programming with too much passion. That ...
ChaosPandion's user avatar
  • 6,313