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
1
vote
1 answer

Programming paradigm with heavy OO constraints

Hey. I remember reading somewhere about a programimng paradigm that has very tough restrictions about OO. It forbids nested ifs and elses entirely, avoid functions in the global namespace not associated with a class, and stuff like that. It's…
ooboo
  • 16,259
  • 13
  • 37
  • 32
1
vote
1 answer

Size of redis database (2N or N^2)

I have a redis database, and client for it, written in Ruby. What is the size of this database? def follow!(user) $redis.multi do $redis.sadd(self.redis_key(:following), user.id) $redis.sadd(user.redis_key(:followers), self.id) …
Mark Pegasov
  • 5,109
  • 9
  • 26
  • 30
1
vote
1 answer

Classical Inheritance Divergence

I'm wondering what should be done in the case of needing Roles or Traits but in a classical inheritance environment. I have stemming of a class down two roads, both of which stem from a root class, however, I want to link the diverged classes on the…
Kyle
  • 3,935
  • 2
  • 30
  • 44
0
votes
1 answer

Is there any elegant way to prevent a class from holding private data?

In a recent code refactor, I'm fulfilling an idea that isolates data handling from data itself. It's something like Chain-of-responsibility - processing units providing the ability to handle the data within a particular business scope while data…
fwonce
  • 397
  • 1
  • 5
  • 18
0
votes
3 answers

How is inlining more efficeny than recursive definition?

My Programming Paradigms textbook, Essential of Programming Languages (3rd ed), Chapter 1 has an exercise: Exercise 1.12 Eliminate the one call to subst-in-s-exp in subst by replacing it by its definition and simplifying the resulting procedure.…
CppLearner
  • 16,273
  • 32
  • 108
  • 163
0
votes
3 answers

One datasource for project

I'm using wizard to add tables to my project to work with them. Is having just one datasource for project better way? At the moment there is only 5 tables. POST EDIT It's so cumbersome and I'm feeling myself going wrong way to use wizard, that…
kseen
  • 359
  • 8
  • 56
  • 104
0
votes
1 answer

How to choose a Programming Paradigm to work with?

There are many questions in SO about choosing a programming language. To me, I think, the choice becomes easier if I can decide which paradigm/model I am going to work with. But, my question is, When to choose Imperative, OO, Functional, Logic…
user366312
  • 16,949
  • 65
  • 235
  • 452
0
votes
1 answer

Storing car part data in a database

I want to understand if it is possible to store car part data using the Neo4J database paradigm. I'm open to anything, so if something better suits, please suggest how. For example: A car has a VIN, frame number, and a number of specific parts that…
0
votes
0 answers

Static-scope-What is the output?

I'm strugling to understand what is the output of following code (STATIC SCOPE): program Test: var a: integer; procedure Add(a:integer); begin a:= a+1; end; procedure Print; begin a:= a+2; write(a); end; procedure First; var a: integer; begin a:=3;…
Djole
  • 1
0
votes
1 answer

What is the difference between abstraction and declarative programming?

Declarative programming seems to be achievable through abstraction. So what's the difference between abstraction and declarative programming? [ My thought ] I will call the person using the class "server" and the person using the class "client". I…
Ashe
  • 61
  • 7
0
votes
1 answer

Why is mongoDB a database server?

I've recently begun learning mongoDB and came across the phrase "mongoDb is a database server." There was no explanation, and I'm a little confused because servers simply host resources and have an IP address assigned to them. Pretty sure that I am…
one_timer
  • 113
  • 1
  • 6
0
votes
0 answers

Coordinate Compression and how to implemente it?

so i came across this https://usaco.guide/silver/sorting-custom?lang=cpp#coordinate-compression in usaco guide explaining coordinate compression and i didn't understand it really , and there is not much about it online , Can someone help?
0
votes
1 answer

Scheme function for adding elements in nested list

I'm trying to create a scheme program that adds the elements of a given list (both simple and nested). (define (adder a_list) (cond ((null? a_list) 0) ((list? (car a_list))(adder (car a_list))) (else (+ (car a_list) (adder (cdr…
Anon
  • 31
  • 4
0
votes
1 answer

How to avoid code repetition in rust (in struct, and traits)?

This is the Trait example from the rust by example book struct Sheep { naked: bool, noise: &'static str } trait Animal { // Associated function signature; `Self` refers to the implementor type. fn new(name: &'static str) -> Self; //…