Talk:Comparison of programming paradigms

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
WikiProject Computing  
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.

Why the emphasis on Performance?[edit]

The heavy emphasis (roughly half the article) on performance seems to suggest that is the primary driver behind programming paradigm, while completely omitted any analysis on the other costs involved. For instance - a major factor in paradigm choice is development cost - including initial development, testing, various types of maintenance, not to mention the availability of experienced programmers. Combined with the sparsity of citations, this leads me to believe performance section is significantly biased in favor of paradigms favored by performance.

I throw my hands in the air reading this section - I smell an attempt at propoganda masquerading as a wiki section. I hope someone has the time and energy to flush this out - it would be a useful resource! — Preceding unsigned comment added by (talk) 20:45, 30 November 2012 (UTC)

I totally agree. This article missed the target. It's titled “Comparison of programming paradigms”, so I expected some formal talks (ex. nothing about semantics, underlying formal models, to be added to what you already mentioned), … but there was none. This article must have been written by hobbyists. --Hibou57 (talk) 01:34, 22 July 2014 (UTC)

Why do we need this?[edit]

Can this be merged with Programming paradigms? ErikHaugen (talk) 07:09, 10 January 2010 (UTC)

I don't see any reason not to. --Allan McInnes (talk) 22:31, 21 January 2010 (UTC)


Some one has tagged the main section of this article with an OR template. Anon editor User:, who seems to be the main contributor to this article, repsonded with an in-article comment. I'm moving the comment here, since article discussions should take place on the talk page, not in HTML comments embedded in the article. --Allan McInnes (talk) 21:35, 20 January 2010 (UTC)

User:'s comment was:

The section is extracted from existing WIKIPEDIA articles , not original - unless wikipedia articles are O.R.—Preceding unsigned comment added by (talkcontribs)

Please note that even if the material on the current page is assembled from various WP articles, references should still be provided in this article. They should be easy to come by if the material does indeed come from other WP articles. Also please note that the synthesis of material from various WP articles into a comparison, without providing citations for an external source for the way things are categorized or the method of comparison, may constitute original research under the terms of WP:NOR. Using, for example, Van Roy's paper as a source for the method of comparison would probably be a better approach. --Allan McInnes (talk) 21:40, 20 January 2010 (UTC)

Actually, I did originally put several references (like this [1]) to the wikipedia articles into this article - but they were removed by one editor (apparently because of some other Wikipedia rule about not giving references to other wikipedia articles in wikipedia articles). In any case a "direct" wikipedia hyperlink (double square brackets) to the other wikipedia articles is itself a reference and you will find most of the words are indeed links of this type.
I have not read "Concepts, Techniques, and Models of Computer Programming" but there is nevertheless an external reference to Van Roy's chart[2] in the article (that does not IMHP seem to clarify much at all - which is why I produced the comparison using existing articles in a more - down to earth - understandable "list style" manner).
The way things are "categorized" (indexed, more like) is "exactly what it says on the tin" - by simple common (immutable? & difficult to argue with) concepts such as state,datafield,subroutine,structure,constant,variable,record,event,asynchronous etc, - each of which has its very own linked wikipedia article. There is "very little new under the sun" in reality and a list is of basic elements is a simple and largely uncontentious taxonomy from which everyone can draw their own conclusions.
There are existing similar lists comparing computer languages - for example showing different ways of "doing the same thing" in each language. If you feel there are essential columns missing from the list, you are of course free to add your own. If you feel there should be footnotes to particular items, again you might like to add them.
If indexing is considered original research in this context, then I will eat my hat (an object that is a headpiece).ken (talk) 08:50, 21 January 2010 (UTC)
Post script - I intended to add some links to diagrams to illustrate each separate paradigm but have been unsuccessful in my search so far. If you know of a source for such diagrams, perhaps you can divulge it. Otherwise I may be obliged to create my own and donate them to wiki commons - A picture is worth a thousand words and IMHO encapsulates[3] a concept indelibly [4]. How come we don't appear to have any thus far?ken (talk) 09:11, 21 January 2010 (UTC)

Please have a read through Wikipedia's policies on verifiability and reliable sources, if you haven't already. You can't use Wikipedia articles as references in Wikipedia articles. References should be to third-party sources. Internal Wikipedia hyperlinks aren't references (in the sense of WP:V) at all - they're simply a pointer that readers can use to find further information about a given topic.
Your "comparison using existing articles", if it is indeed produced by you rather than based upon some third party source such as Van Roy's paper, probably does constitute original research. If nothing else, you need to be able to justify (using some external reference) the choice of paradigms to list as the "main" ones. Discussion of the relationships between paradigms could probably use referencing too. You don't need to present the material in exactly the same way as the sources - for example you could flatten the structure used in Van Roy's paper if you think it simplifies the presentation - but you do need to make it traceable to reliable sources.
I don't really care about the table of terminology, although given that at the moment it largely seems to serve to illustrate that OOP uses a bunch of wildly nonstandard terminology while everyone else mostly agrees I'm not sure how valuable it actually is.
--Allan McInnes (talk) 11:51, 21 January 2010 (UTC)

Object oriented censorship[edit]

A recent edit deleted two entire columns from the comparison table:

  1. (standardized?) - which is present in most other comparisons of similar nature (programming languages for instance) and
  2. critics? - applicable primarily to imperative and object-oriented paradigms (the rest without (known) current critics

This appears to be deliberate "OOP inspired" censorship because the reason given was simply because they were "low usage" columns !!ken (talk) 18:59, 21 January 2010 (UTC)

Ha! very funny. I think "standardized" is not useful because programming paradigms are not things that are standardized. They are discussed, written about, etc, but they are not the kind of thing that one standardizes. As evidence, I refer you to the column which says "no" in all instances. This column is a category error. Regarding critics, I removed it primarily because it is all but empty. It appears to have been included just as a partisan move by functional language guys :). Just kidding, we assume WP:GOODFAITH - or at least I do :). Seriously, though, it seems like it would be more appropriate if it was fleshed out with more significant criticisms for all or at least many of the paradigms. A critic of fp might be Alexander_Stepanov (also perhaps a critic of oop). I'd add him in, but I think this page has more fundamental problems that need attention first (see my comment above). ErikHaugen (talk) 19:35, 21 January 2010 (UTC)
I will go ahead and remove these columns again in awhile if nobody wants to make a case for "standardized" not being a category error. ErikHaugen (talk) 19:36, 21 January 2010 (UTC)

Erik, If you look at the wikipedia article paradigm you might come across these accepted "standardizations" (scientific worldviews)

All of these had their critics and some still have - which is really why the "standardization" (or in this case lack of) & "critics" columns are there! I believe there might be a valid case for adding "performance considerations" and "maintainability issues" columns for each paradigm too - but that can come later The empty entries in critics column are for the stub to be enhanced ("fleshed out"), if appropriate, by someone who might know better As for Alexander_Stepanov, he is already on the list linked to in the OOP paradigm Regardsken (talk) 21:22, 21 January 2010 (UTC)

"Standardized" means something in this industry, and it doesn't have anything to do with whether "Heliocentrism" has a well defined meaning. People more or less agree on what "functional programming" means, but I don't think there will ever be an ISO committee to decide exactly what it officially means. It seems clear that _you_ mean something different by "standardized" in the table. Can you clarify what you mean by it? (consider using colons to indent here) Having thought about this some more, I think the "critics" column should be morphed into a "disadvantages" column or something - don't list people, list problems and use footnotes or references to link to the reliable sources that articulate the problem. ErikHaugen (talk) 01:24, 22 January 2010 (UTC)
Ha. Even the "agreement" on what "functional programming" means is not all that clear cut. See these threads on Lambda the Ultimate for examples:
I'd also suggest that attempting to list "disadvantages" is going to be contentious at best. Whether or not someone considers a particular feature a disadvantage (for example is mutable state good or bad?) depends largely on what your application domain and priorities are.
--Allan McInnes (talk) 02:00, 22 January 2010
wrt fp, sure, that's why I said "more or less" :).
wrt "disadvantages", I think most people would agree that these things cut both ways - mutable state is bad in some ways, and not having it is bad in some ways. This is engineering, it's all about tradeoffs. I'm not suggesting the table should rank paradigms or something; just that sourced discussions of drawbacks would be more interesting than linking to Dijkstra. ErikHaugen (talk) 05:23, 22 January 2010 (UTC)
Erik, concerning "links to list of critics" - in oop paradigm row for instance. I believe in the "Don't repeat yourself" principal. In other words, if something is said "at the point of use" (the actual OOP article in this case), it is firstly the very best place for it and secondly, if it IS there, don't repeat it elswhere, refer/link to it instead - hence my hyperlink to those critics comments rather than footnotes or repetition. As for including the actual disadvantages - as noted by the critics - the same principal applies - let their criticism remain in the relevant article as a reference (including its existing link to their bio if it exists).
As far as standardized goes, you are really agreeing with my understanding i.e. none of the paradigms have a clear and unambiguous implementations even in terms of terminology. Perhaps you can come up with an attribute that better illustrates this lack of universality? Take object for example - if nearly everything is regarded as an object, it makes it extremely hard to describe anything unambiguously. Students of computer science might be forgiven ,without at least listing OOP's critics, for believing that object oriented programming is the very pinnacle of software technology - since OOP is so widespread and ubiquitous and often described in articles in terms of "progression" from earlier (and by inference, inferior), paradigms. At least if it is accepted that there are other paradigms that have some validity - and are still extant - this notion can be put in perspectiveken (talk) 07:28, 22 January 2010 (UTC).
Given that the entire standardization column simply repeats the word "no", and that (as far as I can tell) the point of the column is to convey an implicit message of some sort, it seems to me that'd be better to simply replace the clutter and ambiguous meaning of the column with a straightforward statement of the intended message. I've taken a go at doing this. Feel free to revert if you disagree. --Allan McInnes (talk) 23:53, 23 January 2010 (UTC)
FYI, "OOP censorship" means that this link [5] for example will disappear faster than a silverfish in a bright room if it ever appears as a real link in a WP article. —Preceding unsigned comment added by (talk) 19:20, 24 January 2010 (UTC)
No, Wikipedia's insistence on reliable sources is why that link would disappear. ErikHaugen (talk) 20:10, 22 March 2010 (UTC)

Terminological errors[edit]

There seem to be a number of ambiguities and errors creeping into the terminology table. Some examples:

  • What is "generic code"? That's a generic (excuse the pun) term. If you mean polymorphism, why not say polymorphism? If you mean "generic programming", well, as this paper points out, that term is overloaded with several meanings.
  • The idea of "dynamic function pointer selection" realistically only makes sense in languages that actually support function pointers.
  • The table lists the OO term for "data structure" as "container", but a container is quite clearly only a kind of data structure.
  • A "datafield" in OO would presumably be a "field", "member variable", or some other term referring to the slot in a record (or object) that contains a value, rather than an "object" which refers to the value itself.
  • Similar confusion appears in the row for "dataitem" (whatever that is - a "value" perhaps?), where the OO term is listed as the nonsensical "Instance of an Object" (objects are instances of classes).
  • Modularity means something different than encapsulation (Bertrand Meyer, in OO Software Construction, describes encapsulation as a synonym for information hiding, and a property found in non-OO languages like Modula-2).

These are all good examples of why it might be a good idea to reference the entries in the table, assuming that it's even worth having such a table (which I'm somewhat skeptical about). --Allan McInnes (talk) 23:04, 21 January 2010 (UTC)

Allan, originally I had used "generic programming" which I changed to "generic code" because it was criticized for the reasons you refer to. :"Generic code", to me, means code that handles a number of different things within the same routine (aka "general purpose"). If you can think of a better description that encompasses this well understood concept (that I was familar and quite comfortable with in the 1960s). The IBM/360 assembler macro pre-processor was perfectly capable of handling multiple data types to easily assemble an "ADD this to that" construct (not called polymorphic) - it was just a simple conditional macro that accepted any (statically typed) operands that tested the type beforehand.
I have literally just found out that the article has been effectively vandalized by you (removing rows entirely without justification - if you think they are wrong, correct them, don't obliterate them - if you don't agree with me, allow me time to read and respond to your criticisms (as I was in the process of doing) before your vandalism (as above). I do not have infinite time to resurect the missing information and add back changes.—Preceding unsigned comment added by Kdakin (talkcontribs)
I now give up entirely ALL wikipedia editing - I can no longer be bothered to answer your criticisms or alter your negativity towards a useful comparison - you will have to forever remain in blissful ignorance of your own doing - I expect the article will be deleted by you or one of the other self appointed wikipedia czars
Signing offken (talk) 08:01, 22 January 2010 (UTC)
What you refer to as "vandalism" was correction. I gave some justification in my edit summaries. Allow me to expand on it here. I removed table rows that were either obviously inapplicable (dynamic function pointer selection, since function pointers are associated with languages rather than paradigms), or obviously not adding useful information (the term modularity is the same in all paradigms - including OOP - there seems little point in including it). I attempted to correct other obviously incorrect entries (the data field, data item, and data structure entries for OOP). I have waited to make other (perhaps more debatable) changes because I wanted to see what your response would be, e.g."data item" vs. the more common "value", some clarification of "generic code" (by which I think you mean polymorphism - that being the common term for it these days even if it wasn't in the 60s - but I'm not sure). As I mentioned above, I am a bit skeptical about the value of this table. But if we're going to have it, I'd rather it be right.
As an aside, please don't throw around the term "vandalism" lightly, or use it simply to refer to edits you just happen to disagree with.
--Allan McInnes (talk) 10:39, 22 January 2010 (UTC)
What you call "obviously inapplicable" - is your opinion. As far as I know, polymorphism may have been "retrofitted" to earlier paradigms but was coined for OOP. Data field, data item, and data structure's are morphed into other terminology in OOP. You say "I wanted to see what your response would be, e.g.'data item' vs. the more common 'value', some clarification of 'generic code' " - but you didn't wait even 24 hours before zapping the rows indiscriminantly (that is not correction).
Footnote "Where ignorance is bliss 'tis folly to be wise"[6]
"If something anticipated arrives too late it finds us numb, wrung out from waiting, and we feel - nothing at all. The best things arrive on time" [7]ken (talk) 16:14, 22 January 2010 (UTC)

Actually, use of the term "polymorphism" for describing code that uses the type of its operands to decide which of several identically-named functions to apply dates at least to 1967 (see Christopher Strachey's 1967 lecture notes on "Fundamental Concepts in Programming Languages"), which places it at pretty much the same time that Simula 67 was introducing the idea of classes and subclasses. Note that (a) Strachey doesn't mention OOP, because it was only in the process of being invented at that point, and (b) the fact that a lecture mentions not only polymorphism but delineates different kinds of polymorphism is a fairly strong indication that the term "polymorphism" had been in use for at least several years prior to 1967. So it's hardly a retro-fitted OO term.
My issue with the table rows involving "data field" and "data structure" is not that those terms are incorrect, but rather that the supposedly corresponding terminology listed for OO was incorrect. As I mentioned above, a container is one kind of data structure, not a blanket term for data structures in OOP (as the Container (data structure) article that you originally linked to makes clear). A "field" in OOP is typically referred to as a "data member" (or indeed sometimes as a "field" - see Meyer's Object-Oriented Software Construction, or the first sentence of WP article on Object-oriented programming), not an object. I do not understand your objection to these edits. Are you saying that I the changes I made are incorrect?
Again, as I mentioned above, I waited for your response on things that seemed debatable (such as "generic code"). I could have made a blanket change in the "generic code" row to "polymorphism", but I wanted to wait and see whether or not I properly understood what you meant by "generic code". The term "data item" doesn't even have a WP article (witness the red links in that table row). Value does. An alternative term might be object, but (a) that seemed more general than what I thought you had in mind, and (b) it seemed likely that it would be construed by you as some kind of attempt at "OOP censorship", whatever that is (note, however, that Strachey's lecture uses the term "object"). I could have made a blanket change, but settled for correcting the OOP column.
Regarding the rows that I removed, they were not removed "indiscriminantly" (sic). I removed three rows, and carefully considered the merits of each one. Of those three, "modularity", if corrected based on the Meyer reference I gave above, would have contained the same word in every column - hardly useful, and simply clutter in the table. "Dynamic function pointer selection" was, as I explained above, not likely to ever be correct since the term can only properly be applied to languages (not paradigms) that actually have function pointers - the row was always either going to be deleted, or completely rewritten. "Black box code" contained a single entry in the OO column, with a term ("information hiding") that is not in any way restricted to OO (David Parnas' seminal paper on information hiding doesn't even mention OO or classes) - again the row would either end up being deleted or completely rewritten. Perhaps these things are, as you say, "my opinion". I don't think so, but I'm quite willing to admit that I may be wrong. The usual way to settle "matters of opinion" on Wikipedia is to provide references from reliable sources. I've mentioned some here that support the edits I've made. Perhaps if you could provide a few that support your claims, then we could settle this debate without acrimony.
--Allan McInnes (talk) 23:56, 22 January 2010 (UTC)

Difference between structured and procedural programming?[edit]

I can't find a good explanation of the difference between structured and procedural programming. From what I see here, the only difference is a name change. Is this the case? If not, we need an explanation. -- (talk) 22:58, 19 March 2010 (UTC)

I actually think - in practical terms - there is indeed little difference. If a program is structured and has no goto's, it can be "long-winded"/repetitive unless procedures are then used to eliminate the sequences of repeated code by "replacing" them with procedure calls's. Once this has been done, it is essentially procedural. If these procedures were "external" (i.e. separately compiled), then they were also modular (and essentially "encapsulated" - in the modern idiom).
If anyone else can suggest other (better?) explanations please try! For my own part, whenever I find myself writing the "same" three lines of code twice, I make a procedure out of it - unless performance (in that section of code) is critical - and change the first occurence and every new occurence thereafter to a call to it.
The alternative technique (if available) is to use conditional* macros (or other pre-processor) so that a procedure can be manually inlined without any significant run-time cost in most cases (*Conditional because the macro can then have an option such as "INLINE=YES" for only those cases where it might be critical).
As an indirect, but very tangible, benefit, the macros could be designed to just as easily generate different code for other environments such as different operating systems or hardware, static or reentrant code etc etc. Also, contrary to current belief, these 1960's (assembler) macro processors were exceedingly powerful and could be used to build very reliable "high level" programs with just a few lines of (normally visible) code - essentially using the don't repeat yourself principle written large. They could also be used (and actually were used by IBM) to generate code in other languages such as COBOL and PL/1 (similarities here with javascript code today generating dynamic HTML pages!) .
There is no reason in fact why Z/Architecture* assembler macro processors could not be used even today to generate "modern" languages with similar benefits (*Z/architecture is simply the latest version of IBM S/S360 from the 1960's). Perhaps if they were used, we would see far less code bloat, and generally more "efficiency-honed" and reliable software. That is what I myself describe as (properly) structured and generic programming!ken (talk) 08:32, 21 March 2010 (UTC)


Having just read this, I can see that there are many overlaps in a traditional programming environment.
For example: VisualBasic under Windows, or indeed a multitasking C program under RISC OS (although you're closer to the nuts'n'bolts in the latter case). Essentially for the majority of the clock cycles, you're waiting on an event. A keypress, a timer, a mouse click...
Upon the event being received, you'll either pass to dispatch code (or the language will dispatch appropriately for you) upon which you will execute a linear sequence of code that will modify the program's state. Flag set. Keypress in array. Make computer blow up. Whatever.
Oh, and for anything larger than a fart app, is isn't just good practice to write the code in modular sections, it is insane not to do so.
Once the event has been handled, you're back to waiting on an event.
One program, three paradigms (RISC OS & C), or four (VB also throws in object oriented - "MyForm.Button.Something = Blah").

Now consider an interrupt-driven sound buffer fill routine so music can be played. When the sound buffer empties, you'll need to fetch more data to stuff into said sound buffer. Your main activity is waiting on an interrupt (event-driven) upon which you do something (imperative) and this is probably going to be organised tidily (procedural) as if you're writing this in assembler you'll quickly come a cropper if the code is a mess. Three paradigms.

Perhaps it might be worth pointing out a little more clearly that such overlaps not only exist, but are par for the course...
HeyRick1973 (talk) 21:08, 21 December 2012 (UTC)

Automata driven example[edit]

Yacc is an example of an automata language. — Preceding unsigned comment added by (talk) 01:01, 9 January 2013 (UTC)

"Main" programming paradigms?/Logic[edit]

I think the paradigms here referenced as the "main" ones can not be complete. The WP page for logic programming states, that logic programming was one of the four main programming paradigms, however it does not appear here... otherwise I agree with the notion that this page could well be merged into "programming paradigms". --Micdi2 (talk) 15:03, 4 June 2013 (UTC)


What I'm missing in the list of the main article is a language like SQL which, to my understanding, is "group oriented" and as such requires a totally different thinking than with procedural prorgamming. — Preceding unsigned comment added by (talk) 18:22, 21 May 2014 (UTC)

I think you mean declarative languages, right? This article is a good draft but still stays as a draft and not as a complete research about programming paradigms. — Preceding unsigned comment added by (talk) 13:10, 31 October 2014 (UTC)