Questions tagged [imperative-programming]
The imperative-programming tag has no summary.
35 questions
16
votes
7
answers
9k
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 ...
0
votes
1
answer
122
views
How are asynchoronous problems handled with imperative programming?
Context
To level set, I've been working with OOP and FP for my whole career, so my experience with the imperative paradigm is limited. The team I joined is made up of very senior (20+ years xp) ...
3
votes
5
answers
1k
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 ...
10
votes
4
answers
2k
views
Functional architecture with lots of I/O
I'm learning about "Functional Core, Imperative Shell" as espoused by Gary Bernhardt in his talk about "Boundaries". In reality, it seems like these ideas have been known for a ...
0
votes
1
answer
169
views
Imperative parallels to Haskell's Monad operations
Would it be (mostly) correct to say that the following are the parallels to the Haskell Monad operations in the imperative world?
Monad's >> ~ C/C++/JavaScript/etc. , operator
do expressions ~ C/...
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 ...
4
votes
1
answer
130
views
Is a generic data structure customary for use in a self contained program, or can I duplicate source files?
I have a project that does some Dijkstra searches on a graph, I implemented a red-black tree and priority queue that I use for the nodes, however I also need the same data structures for other things ...
1
vote
2
answers
375
views
What is the difference in the implementation of a monad in a purely functional language with respect in an imperative language?
For a long time, the use of these Monad structures has been restricted to a very small circle of languages, many of them purely functional (mainly due to problems related to the management of the IO). ...
12
votes
4
answers
3k
views
Why usage of assignment operator or loops discouraged in functional programming?
If my function meets the two requirements listed below, I believe that the function Sum returns the summation of the items in a list, where item evaluates as true for a given condition. Doesn't this ...
11
votes
3
answers
5k
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, ...
4
votes
2
answers
737
views
Dynamic dispatch with captured data in C?
I'm trying to reconcile my object-oriented/functional mind with programming in a language with C. Let's say I want to achieve dynamic dispatch in C, say I want to have a collection of tasks to execute....
4
votes
1
answer
442
views
Can heavy use of the service pattern substitute pure functions without losing benefits?
There are huge benefits to pure functions in functional programming, but can the same benefits be obtained in imperative programming with heavy use of the service pattern?
I ask because I want to ...
1
vote
0
answers
344
views
What are the types of tasks for which Functional Programming paradigm really wins over imperative one? [closed]
During its evolution C# gradually gets more and more features which belong to functional paradigm.
Subjectively these features allow (at least me) to be more productive, fluent and write maintainable ...
3
votes
2
answers
222
views
What is the most idiomatic way to iterate collection with different action for first element?
Sometimes we meet a situation where we should iterate (or map) over a collection, applying the same procedure (function) for all elements except the first one. The simplest example is finding the max ...
3
votes
3
answers
622
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 ...