Talk:Comparison of programming paradigms

Latest comment: 3 months ago by Mathnerd314159 in topic Entire Article seems to be original research

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 167.24.104.150 (talk) 20:45, 30 November 2012 (UTC)Reply

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)Reply

Why do we need this? edit

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

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

OR? edit

Some one has tagged the main section of this article with an OR template. Anon editor User:86.139.34.202, 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)Reply

User:86.139.34.202's comment was:

The section is extracted from existing WIKIPEDIA articles , not original - unless wikipedia articles are O.R.—Preceding unsigned comment added by 86.139.34.202 (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)Reply

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)Reply
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)Reply


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)Reply

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)Reply

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)Reply
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)Reply

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)Reply

"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)Reply
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)Reply
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).Reply
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)Reply
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 86.144.51.137 (talk) 19:20, 24 January 2010 (UTC)Reply
No, Wikipedia's insistence on reliable sources is why that link would disappear. ErikHaugen (talk) 20:10, 22 March 2010 (UTC)Reply

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)Reply

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)Reply
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)Reply
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)Reply


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)Reply

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. --68.32.37.109 (talk) 22:58, 19 March 2010 (UTC)Reply

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)Reply

Paradigms? edit

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) XP_2600 (talk) 07:42, 19 April 2022 (UTC)Should not Python be an event driven as well?Reply

Automata driven example edit

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

"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)Reply

SQL? edit

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 84.63.176.61 (talk) 18:22, 21 May 2014 (UTC)Reply


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 195.212.29.185 (talk) 13:10, 31 October 2014 (UTC)Reply

Entire Article seems to be original research edit

There's been a tag on this article asking for more references since 2015. There are still almost no references in the whole thing. Should the whole article be deleted? Twasonasummersmorn (talk) 20:44, 15 March 2021 (UTC)Reply

There's been almost no improvement on this page in 2 years. It's still wandering around with barely any references. Is there a way to do something useful about that? While I know a fair bit about the topic, I don't know good references. But this is ridiculous. Twasonasummersmorn (talk) 00:24, 3 January 2023 (UTC)Reply
I read through the article and didn't see anything worth keeping. The initial section relies on one weak source, and otherwise is unsourced. The table duplicates the paradigm pages and the listing of paradigms in each PL's infobox. The "differences in terminology" section is uninformative on actual differences. "Language support" just talks about syntactic sugar and the actual syntactic sugar article is more useful. The performance comparison is complete BS as I think trying to compare paradigms on any sort of performance metric is going to be fraught with peril - if there was a paper that did it, maybe we could cite it, but not this Wiki-OR nonsense. The "Serializing objects" section is trying to make some point about OO being longer to serialize? Also BS. And then the parallel computing section doesn't even mention parallelism, it is just about an FP course at CMU.
I would say to submit to AfD, some articles are better rewritten from scratch if they are necessary. Mathnerd314159 (talk) 06:54, 1 February 2024 (UTC)Reply

bad pseudocode edit

the pseudocode is confusing, includes confusing numbers next to each instruction, doesn't seem to further the point, and makes everything more difficult to read and understand. I don't see why its needed ~~

What about Service-oriented Programming ? edit

I am looking for more information about comparison between Event-driven programming and Service-oriented programming, for me this is 2 opposing paradigms. Here is how I see the things.

Event-driven programming is about to trigger/catch events when something happen to a form or an entity. Then a listener catches event when it needs to react (e.g USER_CREATE to save the user account in database, USER_CREATED to send an email to the user when his account is created). This could also be used for validation purposes. The controller is throwing an event and any listener is getting it.

Service-oriented programming is about a singleton class for a business need or an entity. In case of entity service, this one is managing the business of this entity (or sometimes several entities) and sometimes all its lifecycle. The controller is explicitly calling the service method to do what it needs (e.g UserService::create() to save the user account in database) then the service is delegating sub-tasks.

https://en.wikipedia.org/wiki/Event-driven_programming https://en.wikipedia.org/wiki/Service-oriented_programming (I think this article is more about Service-oriented architecture than programming...)

Finally to say, in this article, the Service-oriented programming is totally missing.

Loenix (talk) 06:32, 12 June 2021 (UTC)Reply

non-prototypical examples edit

Examples that are in two or more categories should be removed from the examples list entirely. The fact that they're suitable for multiple paradigms makes them unsuitable as exemplars of any particular paradigm. This is an article on programming paradigms. It's not here to promote any particular programming language. If someone is coming here to learn about the different paradigms, then listing multi-paradigm languages as examples is not helpful. 2604:CA00:168:40B5:0:0:1068:29FB (talk) 15:54, 1 July 2023 (UTC)Reply