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
6
votes
2 answers

Should object-oriented principles be applied in procedural languages?

I know that it's possible in principle to turn even procedural languages such as C or MATLAB into object-oriented ones. This question has been fairly well discussed here and here. What I found missing from these discussions and the references…
lindelof
  • 34,556
  • 31
  • 99
  • 140
6
votes
1 answer

Markup/Style best practices: How to efficiently distribute style rules over CSS classes?

Assume that I have some HTML page, and a corresponding CSS file. I'd like to add rounded corners to some elements. I want to alternate background colors on every other section. I want to add a hover state for each section heading. So forth and…
Chris Tonkinson
  • 13,823
  • 14
  • 58
  • 90
6
votes
0 answers

Why does this constructor not return a string?

Consider: function Panda() { this.weight = 100; return [1,2]; } console.log(new Panda()); When we instantiate with new keyword (new Panda()), it will returns: [1,2] Without return statement, it returns: { weight: 100 } function…
André Vinícius
  • 411
  • 4
  • 12
6
votes
4 answers

What is the canonical way of handling different types in Python?

I have a function where I need to generate different output strings for another program I invoke, depending on which type it wants. Basically, the called program needs a command line argument telling it which type it was called with. Happily I found…
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
6
votes
3 answers

Efficiency passing variables to modules in a embedded c programming background

I am programming C in an embedded target. Due to the increasing complexity and testability issues, modularity is a must. At a glance, the program is a control loop. Read physical inputs using internal hardware, apply some calculations, and apply…
Manex
  • 528
  • 4
  • 15
5
votes
7 answers

return multiple values in python without breaking previous code

I had a version 1 of a function like: def f(a,b,c): #Some processing return some_result Later, I upgraded it to version 2. def f(a,b,c): #Some processing #Some more processing return some_result, additional_result The latter…
jerrymouse
  • 16,964
  • 16
  • 76
  • 97
5
votes
1 answer

Is Fortran a purely functional language?

I understand that some languages combine elements for many different paradigms in programming. I'm told that Fortran is an example of a Functional language, however I'm just a little confused as to whether or not it is purely functional, as it seems…
5
votes
2 answers

Can this be considered a pure function (functional programming)?

I've been reading about functional programming and its concepts. It's clear to me that when working in big projects you always need to mix (at some adequate level) multiple paradigms such as OO and functional. In theory, concepts such as function…
thiagoh
  • 7,098
  • 8
  • 51
  • 77
5
votes
2 answers

Is overloading operators in C# actually good practice?

Being new to C#, I am aware of the purpose and uses of operator overloading, and I can see how it's sometimes elegant in very specific cases such as negating a value object to negate all of its fields at once, however such things can always be done…
Andreas Hartmann
  • 1,825
  • 4
  • 23
  • 36
5
votes
3 answers

What are the different programming language concepts and which languages show them in a pure way

I am no language expert but I'm recently into languages and trying to get an overview of major concepts and "their" languages. This is similar to another question about books. So first, what are the major programming language concepts,…
Peter Kofler
  • 9,252
  • 8
  • 51
  • 79
5
votes
3 answers

Where do you put the .jar file for an external library in java

This is probably a pretty stupid question. I just learned how to use external libraries in java by adding the .jar file to the classpath and whatnot, but where exactly do you keep the .jar file? In a video tutorial about adding .jar files to the…
user3002473
  • 4,835
  • 8
  • 35
  • 61
5
votes
1 answer

Android Studio "mobile" and "wear" project modules, shared components location

In my Android Studio project there are two android modules "mobile" and "wear", these seem to be the views and controllers for the types of android devices that will be able to run this application I expect them to share some logic, such as the…
CQM
  • 42,592
  • 75
  • 224
  • 366
5
votes
3 answers

Differences & Similarities Between Programming Paradigms

I've been working as a developer for the past 4 years, with the 4 years previous to that studying software development in college. In my 4 years in the industry I've done some work in VB6 (which was a joke), but most of it has been in C#/ASP.NET.…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
5
votes
5 answers

Why does OpenGL have global functions?

Why isn't openGL object-orientied? Everybody teaches Object Orientated Programming + Design Patterns, but OpenGL has many global functions. Isn't this bad style?
mr.bio
  • 1,646
  • 4
  • 19
  • 27
5
votes
3 answers

Functional Programming Documentation

Is there any standard documentation (like UML for OO) for functional languages? After downloading couch db which is written in erlang and looking at the source code I was shocked, there is hardly a line of documentation. Is there no need to document…
stacker
  • 68,052
  • 28
  • 140
  • 210