Questions tagged [paradigms]

A tag for questions relating to the world view underlying a particular software methodology or theory.

A tag for questions relating to the world view underlying a particular software methodology or theory.

A paradigm is a model, method or pattern. In programming different methods of writing programs are called , examples are and functional programming.

More information on paradigms

291 questions
2
votes
1 answer

What is the output when you use shallow binding?

x : integer := 3 //global scope y : integer := 4 //global scope procedure add x := x + y procedure second(P : procedure) x : integer := 5 P() procedure first y : integer := 6 second(add) first() …
2
votes
2 answers

Generics of Generic types

I am about to start learning Rust after programming in C++. I am unsure how to create a function (or anything else generic) that takes a generic type as its template argument. I have tried to compile the following code: trait Monad { fn…
user13507303
2
votes
4 answers

Refactor from Procedural Paradigm to Functional Paradigm

In the process of learning functional programming, I am trying to refactor the following code using map, filter, and/or reduce. I see that I can deal with the conditional using the filter method, but don't know how to handle the repeated assignment…
efw
  • 449
  • 3
  • 16
2
votes
0 answers

Objects into functions

I have a question that my teacher asked me and I could not find the answer, I am still searching in pdf for public institutions how mit (which are public), utn or related, if anyone can answer me or tell me where I can find it, thank you. Objects…
2
votes
2 answers

What is the difference between object oriented programming and procedural programming?

From what I can gather procedural programming uses procedures and functions or sub routines. It gives a step by step instruction on what to do. Though object oriented on the other hand im not entirely sure. All I have seen is that it uses "objects"…
Lewis Roberts
  • 57
  • 1
  • 6
2
votes
2 answers

Whose resposibility should it be to check preconditions?

In procedural languages where functions are a key player, the design by contract paradigm basically says that there is an agreement between a function that takes parameters and the caller. The agreement goes something like "if the caller ensures…
Mode77
  • 991
  • 8
  • 28
2
votes
1 answer

How to return a list from list of list in scheme?

I am trying to return from '('(animal '(name a b c) '(age 1 2 3) '(family x y z)) only '(name age family). How do I do that? I was trying this: (car(apply append(cons (cadr (car list)) '()))) but I get an error.
user378042
  • 21
  • 2
2
votes
2 answers

How are loops implemented in functional languages

In functional languages such as Scheme or Lisp there exist for and for-all loops. However for loops require mutation since it's not a new stack frame each iteration. Since mutation is not available in these languages explicitly how do these…
2
votes
3 answers

What tools/programming languages do people use that support TDD?

I want to get an idea of What tools/programming languages people are using that supports Test Driven Development? Many Thanks, J
JHarley1
  • 2,026
  • 6
  • 24
  • 34
2
votes
2 answers

Capture values from one list in Prolog and add to another list

I'm trying to develop code in prolog to capture items with frequency 0. Look at the example, the tuple: [[1,31],[2,0],[3,21],[4,0],[5,0]] Where each element is something else with 2 elements each, so the elements that should be captured are 2, 4…
2
votes
2 answers

Is there a programming language oriented to description of interaction between agents?

I want to create different kinds of processes in which agents interact with each other. I want to describe (define, formalize) processes of interaction between agents using a special language. In other words, I want to provide an environment where…
Roman
  • 124,451
  • 167
  • 349
  • 456
2
votes
1 answer

Differences between imperative and declarative programming languages?

I know what they are: In an imperative programming language you tell the compiler what you want to happen step by step, whereas in a declarative language you write code which describes the result but not necessarily how to achieve the desired…
madcrazydrumma
  • 1,847
  • 3
  • 20
  • 38
2
votes
1 answer

Essential language paradigms for professional developer

So I guess most (all?) programmers start out learning a mainly imperative/ procedural programming paradigm, and probably learnt some form of object-oriented programming fairly shortly after that. I've read plenty of questions on stackoverflow…
guhou
  • 1,732
  • 12
  • 32
2
votes
5 answers

What other Language synergizes well with Python? Need Advice

Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer…
user126726
  • 51
  • 1
  • 4
2
votes
1 answer

Difference in web server paradigms (Apache vs. Reverse proxy + Web server)

I have starting developing with Ruby on Rails, and I have encountered what it has been described as a different paradigm when it comes to web servers. Old paradigm (apache) ===================== +--- web process fork …
Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189