The tag has no wiki summary.

learn more… | top users | synonyms

-4
votes
0answers
75 views

Does imperative programming have a (mainstream) future? [on hold]

I have written a few small programs in Python and C++ and am currently learning F# (I am already quite familiar with FP concepts, as a result of reading the Learn you some Haskell tutorial until the ...
0
votes
1answer
139 views

Advantages of the imperative style over the functional style [duplicate]

There's a lot of hype over functional languages right now, and I've spent the last year studying Haskell as my intro to FP as a result. Seeing the advantages FP provides is easy (such as referential ...
-4
votes
4answers
129 views

Does this python program obey functional paradigm?

Below is the hailstone sequence program considering the rule of thumb in functional programming. The simple rule of thumb is: if you can replace any expression, sub-expression or subroutine call ...
1
vote
1answer
117 views

How do I enforce 'referential transparency' in this program?

Below is the python program written to follow the rule of thumb in functional programming. The simple rule of thumb is: if you can replace any expression, sub-expression or subroutine call with ...
8
votes
5answers
1k views

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
votes
1answer
89 views

How to encourage to write pure functions in imperative environments? [closed]

In functional programming languages, a developer is always cautious about writing pure functions. Some functional languages simply do not allow impure functions, and some other functional languages ...
2
votes
2answers
154 views

Cognitive Modeling Programming vs Imperative Programming vs Declarative Programming

I'm reading this article by John Funge about Cognitive Modeling for Computer Games: http://www.qrg.northwestern.edu/resources/aigames.org/1999/fungegame99.pdf And some further detailed reading about ...
1
vote
4answers
406 views

Is it possible to use functional paradigm in imperative languages?

If I understand the concept correctly the goal, which functional languages are trying to achieve is to eliminate any side effects from functions and to eliminate a state. The rationale behind this is ...
2
votes
3answers
305 views

Inheritance in imperative programming

My first introduction to programming was Java, which was horrible so I learnt Actionscript3 which was nice... "The point is" OOP was my introduction to programming where by I went on to gain a career ...
1
vote
1answer
464 views

how to enumerate/generate all possible binary trees from N leaves and N-1 nodes?

I am trying to implement the 24 Game in ansi C. This game goes as follows: For a list of four given numbers, try to find a solution involving these four numbers, that, using addition(+), ...
24
votes
3answers
2k views

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, ...
0
votes
1answer
231 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 ...
9
votes
5answers
638 views

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 ...
5
votes
1answer
3k views

Why is imperative programming preferred over functional programming? [closed]

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 ...
6
votes
2answers
1k views

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 / ...
5
votes
2answers
276 views

Does the structured programming definition only consider imperative programming?

Does the structured programming definition only consider imperative programming? By this I mean does the definition of structured programming automatically exclude functional programming (in the most ...
22
votes
5answers
3k views

How to make the transition to functional programming?

Lately, I have been very intrigued with F# which I have been working a bit with. Coming mostly from Java and C#, I like how concise and easily understandable it is. However, I believe that my ...
11
votes
4answers
7k views

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

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 ...
45
votes
3answers
12k views

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