Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Wikipedia defines programming paradigm thus:

a fundamental style of computer programming

which is echoed in the descriptive text of the tag on this site.

I find this a disappointing definition. Anyone who knows the words programming and paradigm could do about that well without knowing anything else about it. There are many styles of computer programming at many level of abstraction; within any given programming paradigm, multiple styles are possible. For example, Bob Martin says in Clean Code (13),

Consider this book a description of the Object Mentor School of Clean Code. The techniques and teachings within are the way that we practice our art. We are willing to claim that if you follow these teachings, you will enjoy the benefits that we have enjoyed, and you will learn to write code that is clean and professional. But don't make the mistake of thinking that we are somehow "right" in any absolute sense.

Thus Bob Martin is not claiming to have the correct style of Object-Oriented programming, even though he, if anyone, might have some claim to doing so. But even within his school of programming, we might have different styles of formatting the code (K&R, etc). There are many styles of programming at many levels.

So how can we define programming paradigm rigorously, to distinguish it from other categories of programming styles? Fundamental is somewhat helpful, but not specific. How can we define the phrase in a way that will communicate more than the separate meanings of each of the two words—in other words, how can we define it in a way that will provide additional meaning for someone who speaks English but isn't familiar with a variety of paradigms?

share|improve this question
    
are you asking this about the definition of programming paradigms in general or as it relates to the tag paradigms? –  Ryathal Sep 27 '12 at 15:21
1  
Though reading the wikipedia article lists a lot of things as "paradigms", I have always understood paradigm to be more fundamental than those. I am only familiar with imperative and declarative, but I feel they're all encompassing between the two of them to the point one could say, all other types of programming are subsets of those two. Those at the root in my head are paradigms, everything below them is an... architecture? style? pattern? implementation detail? Perhaps we need a word for things that are not "paradigms" –  Jimmy Hoffa Sep 27 '12 at 15:22
2  
If you read the article further, you find: "There are four main paradigms : object-oriented, imperative, functional and logic programming.[1] Their foundations are distinct models of computation", which (to me) clearly tells how a programming paradigm is different from a local style or idiom. The latter live - and often make sense only - within the space defined by a specific programming paradigm. –  Péter Török Sep 27 '12 at 15:26
1  
Paradigm is more like a pattern than coding style –  superM Sep 27 '12 at 15:37
    
@superM Good point—can you turn that into an answer? –  Kazark Sep 27 '12 at 15:38

4 Answers 4

up vote 5 down vote accepted

Thomas Kuhn defines paradigm in The Structure of Scientific Revolutions as:

Attempting to discover the source of that difference led me to recognize the role in scientific research of what I have since called “paradigms.” These I take to be universally recognized scientific achievements that for a time provide model problems and solutions to a community of practitioners.

Merriam-Webster offers three definitions1, the third one being the most relevant:

  1. example, pattern; especially: an outstandingly clear or typical example or archetype
  2. an example of a conjugation or declension showing a word in all its inflectional forms
  3. a philosophical and theoretical framework of a scientific school or discipline within which theories, laws, and generalizations and the experiments performed in support of them are formulated; broadly: a philosophical or theoretical framework of any kind

The term is quite commonly used and well understood in scientific environments, we don't need to further define it. A programming paradigm is simply a paradigm of the programming discipline, and that's about it.

The Wikipedia article you link to offers more of an explanation, perhaps targetted to people without a programming or other scientific background, than a definition. It's an encyclopaedia after all, not an authoritative software development reference.

1 Example is used prominently in the first two definitions, because paradigm (παράδειγμα) is the Greek word for it.

share|improve this answer
2  
Wonderful invocation of Thomas Kuhn –  ihtkwot Sep 27 '12 at 15:43

Very good explanations of programming paradigms and the programming concepts from which those paradigms are built are found in Peter van Roy's works. Especially in the book Concepts, Techniques, and Models of Computer Programming by Peter Van Roy and Seif Haridi. (Here's the companion wiki.) CTM (as it is colloquially known) uses the multi-paradigm Distributed Oz programming language to introduce all the major programming paradigms.

Peter van Roy also made this amazing poster that shows the 34 major paradigms and their relations and positions on various axis. The poster is basically an incredibly compressed version of CTM. A more thorough explanation of that poster is contained in the article Programming Paradigms for Dummies: What Every Programmer Should Know which appeared as a chapter in the book New Computational Paradigms for Computer Music, edited by G. Assayag and A. Gerzso. It explains for example very concisely and easily understandable, what a programming paradigm actually is, what a programming concept is, and how the two are related.

share|improve this answer

So how can we define programming paradigm rigorously, to distinguish it from other categories of programming styles?

You don't.

Program design is the side of programming that is more craftsmanship than engineering. People don't go around trying to rigorously define painting's Cubism, or Gothic architecture. They're terms that people apply to label categorizations. They're not evolved out of some natural truth. If a building uses pointed archways, then it better fits into the Gothic category.

Likewise, if I tend to use pure methods and immutable data, the design has a Functional slant. The concepts can be mingled and adapted, and evolve over time. It's rare when modern programs aren't a shade of grey with traits of different paradigms.

share|improve this answer

After seeing the comments and Yannis' answer, I suggest this definition:

The fundamental structural style of code that undergirds its design, based on an underlying computational model.

This definition...

  • ...highlights what type of style we are talking about; not just a naming scheme or an indentation style, but one that concerns the way the code is designed.
  • ...highlights the relation of programming paradigm to the underlying lambda calculus or Turing model, etc.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.