How to choose a Programming Paradigm to work with?

2k Views Asked by At

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 and/or mixed paradigm/model?

What paradigm is good for which type of projects?

1

There are 1 best solutions below

0
On

PROBLEM

You have the choice between several programming methodologies, and you do not know which one to choose for a specific project.

SOLUTION

Determine your primary goals and pick whichever tool suits your goals most effectively.

If you do not know your goals, start with three questions that will help you focus your energies and direction:

  1. what is the subject matter at issue (problem-domain);
  2. who is available to help me learn (mentors);
  3. what pre-existing projects and source code can I find -- and how best can I learn, understand and apply from them (examples);

DISCUSSION

The question could be refined a bit, because you state that you want a solution for a project, but you do not specify the goals of the project.

For example:

  1. You want to learn how to be a programmer as a novice;
  2. You want to learn how to be a better programmer, filling in the gaps;
  3. You are an experienced programmer and you want something that will be fun;
  4. You are a professional programmer and you want marketable skills
  5. You are an exceptional programmer and you want to design a new language without re-inventing the wheel

RATIONALE

The jargon in computer programming is sometimes very misleading. For example, if you were to ask any two programmers for the precise definition of OO versus Functional, you will almost certainly never get the same answer from both.

This in itself is an important lesson in programming and learning how to program. The ability to see the forest for the trees and not get so enamored of methodologies or tools so much that one loses focus of the underlying goals and motivations (which change).

SEE ALSO

There is a write-up going into more detail about the Jargon of OOP versus Functional programming. (See e.g., Jargon-free introduction to OOP)

simple explanation PHP OOP vs Procedural?