Questions tagged [imperative-programming]

35 questions
112
votes
4 answers

What's The Difference Between Imperative, Procedural and Structured Programming?

By researching around (books, Wikipedia, similar questions on SE, etc) I came to understand that Imperative programming is one of the major programming paradigms, where you describe a series of commands (or statements) for the computer to execute…
57
votes
4 answers

Development process used for the code on Apollo 11 missions?

The Apollo missions had technology no more complicated than a pocket calculator. From link here, there's an information about Apollo Guidance Computer (AGC) The on-board Apollo Guidance Computer (AGC) was about 1 cubic foot with 2K of 16-bit RAM…
40
votes
4 answers

What is referential transparency?

I have seen that in imperative paradigms f(x)+f(x) might not be the same as: 2*f(x) But in a functional paradigm it should be the same. I have tried to implement both cases in Python and Scheme, but for me they look pretty straightforward the…
asgard
  • 667
  • 1
  • 7
  • 9
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
1 answer

Why is imperative programming preferred over functional programming?

Background: I am proponent of functional programming who works at a VB.NET shop where the prevailing mental model is imperative programming. Being that foundation of our system is WinForms I can understand we're not going to get entirely away from…
13
votes
4 answers

Example of where Functional Programming is Superior to Imperative or Object-Oriented Programming?

Possible Duplicate: Which problems domains are more suited to functional programming solutions I've been reading about functional programming. I've been using mostly C#.net recently, and I would like to know of a good real-world example of…
12
votes
4 answers

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 mean that the function can be classified as…
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…
11
votes
2 answers

Functional programming, compared to the process of a computer

In functional programming, it is considered bad practice (at least from my observations) to use state changes. Since computers operate in an imperative-language-like matter (performing one operation at a time, changing states of RAM), isn't…
10
votes
5 answers

Can a pure-functional solution to this problem be as clean as the imperative?

I have an exercise in Python as follows: a polynomial is given as a tuple of coefficients such that the powers are determined by the indexes, e.g.: (9,7,5) means 9 + 7*x + 5*x^2 write a function to compute its value for given x Since I am into…
8
votes
5 answers

How to structure a loop that repeats until success and handles failures

I am a self-taught programmer. I started programming about 1.5 years ago. Now I have started to have programming classes in school. We have had programming classes for 1/2 year and will have another 1/2 right now. In the classes we are learning to…
wefwefa3
  • 997
  • 3
  • 10
  • 21
7
votes
3 answers

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 long time, and put into practice with languages like Elm or Haskell.…
6
votes
2 answers

Differences between imperative-language and functional-language debuggers

Up to now I have always worked with imperative languages like Pascal, C, C++, Java in a production environment, so I have experience with debuggers for these languages (Turbo Pascal, Turbo C, GDB / DDD, Visual Studio, Eclipse). A debugger for an…
Giorgio
  • 19,486
  • 16
  • 84
  • 135
1
2 3