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.

25 questions
29
votes
3 answers

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 large part of SQL is knowing just how an…
Paddy3118
  • 617
  • 1
  • 5
  • 10
25
votes
9 answers

The dream of declarative programming

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) && asc(sort(A)) and automatically get a sorting…
user7146
18
votes
5 answers

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" distinct from imperative languages such as…
14
votes
7 answers

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 language, that instruct the machine to compute,…
14
votes
6 answers

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 difference between imperative and declarative…
NSjonas
  • 267
  • 1
  • 8
13
votes
4 answers

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 being said I feel like it is easier to write correct…
ChaosPandion
  • 6,305
  • 2
  • 33
  • 33
11
votes
3 answers

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, according to Wikipedia, a side effect is related…
7
votes
1 answer

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? I want to write idiomatic code, but this appears…
pluralMonad
  • 173
  • 2
5
votes
7 answers

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

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 because it is closer to math. And I would say that…
5
votes
2 answers

Is declarative programming overrated?

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 applying some of the declarative-style…
4
votes
3 answers

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, rather than having to mess around with change…
Benjol
  • 3,747
  • 5
  • 33
  • 41
3
votes
5 answers

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 paradigm in which the programmer instructs the…
3
votes
3 answers

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 respectively. In most of places where this difference…
3
votes
3 answers

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 exactly HOW to do the motor control. And for…
3
votes
2 answers

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 in the WHERE clause. Show the columns of the…
Utku
  • 1,922
  • 4
  • 17
  • 19
1
2