Jump to content

Talk:Computer program

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ClueBot III (talk | contribs) at 04:40, 6 February 2024 (Archiving 1 discussion to Talk:Computer program/Archive 4. (BOT)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Former good articleComputer program was one of the Engineering and technology good articles, but it has been removed from the list. There are suggestions below for improving the article to meet the good article criteria. Once these issues have been addressed, the article can be renominated. Editors may also seek a reassessment of the decision if they believe there was a mistake.
Article milestones
DateProcessResult
November 4, 2007Good article nomineeNot listed
November 9, 2007Good article nomineeListed
November 17, 2007Good article reassessmentDelisted
October 28, 2021Good article nomineeNot listed
June 7, 2022Good article nomineeNot listed
June 25, 2022Good article nomineeNot listed
Current status: Delisted good article


Suggested outline (2022-06-28)

Overall, the current article is well cited and has some good material, but its organization is a bit of a mess. It consists of a hodge podge of vaguely related topics, and the delineation between sections is unclear. Additionally, the article doesn't seem focused around "computer program" as a central theme. It contains several subsections now which elaborate on things of unclear relevance to computer programs -- for example the BNF discussion under "Syntax and semantics" uses linguistics as an example and is only tangentially relevant to what a "computer program" is. Recent edits have moved some things around and added material, and these have mostly been improvements I think, but there's still a ways to go.

Here is a draft suggested outline that I think would make sense. What do you think?

1. History (the earliest computer programs and overview of how the notion of a program has evolved)

2. Modern computer programs (survey of what a computer program means today)

This is a current major omission from the article. What I have in mind is illustrating through examples what today's computer programs are and look like. This section could incorporate much of the material currently under Imperative Languages and Declarative Languages as example programs.
The "hello world" section might also fit here. It's currently out of place but could instead be "examples" or something.
It would be great for this section to also include some empirical survey information such as: who writes programs today, what language(s) are they typically written in, etc.

3. Program elements

3.1 Syntax and Semantics
This is currently under "programming langauges and paradigms" but it doesn't quite fit there. It's more fundamental to what a program is.
3.2 ???

4. Programming languages and paradigms

5. Program development (current section titled software engineering & computer programming)

6. Classification of computer programs

4.1 By language
4.2 By platform (OS, architecture)
4.3 By use case (e.g., embedded systems programs, mobile phone apps, web apps, etc.)
4.4 By functional category

7. In popular culture (another section missing right now, could be nice to have)

Caleb Stanford (talk) 18:42, 28 June 2022 (UTC)[reply]

The current structure is just fine. Timhowardriley (talk) 19:02, 28 June 2022 (UTC)[reply]
I generally agree with Caleb Stanford's assessment. (Do you prefer Caleb, Mr. Stanford, something else?) This article should be mostly accessible to people with no programming experience, with occasional detail (perhaps in footnotes) to make it enjoyable for more-experienced folks. Your proposed scope and organization of the article makes sense and is highly navigable. There is just too much inappropriate content in the article at the moment, the most unfortunate being the sprawling C++ code and Makefile. Short snippets of code illustrating different levels of languages is best. I also agree with the emphasis on modern programming; as important as ALGOL, BASIC, etc., are, they are unrepresentative of what programmers do today, which again is very important for the layman. Ovinus (talk) 19:24, 28 June 2022 (UTC)[reply]
This article spends too much time covering things it shouldn't, I can agree on that much. In particular we devote way too much space to object oriented programming and technical details of C and C++ which should just be a brief summary and pointer to their own articles. I disagree that a modern definition of a computer program is much different from a historical one. We have other articles (lots of them! Software development, Computer programming, Software engineering) that can cover the process of programming or what specific tools and language variants are used today. This article should be general in scope - the parent of many child articles, in keeping with Wikipedia:Summary style. Sections on particular platforms and use cases don't really belong here. Also, no popular culture section. This article will not be helped by a collection of cruft and trivia. MrOllie (talk) 20:19, 28 June 2022 (UTC)[reply]
Good point about separate articles, thanks! Ovinus (talk) 21:14, 28 June 2022 (UTC)[reply]
Thanks, you both put it better than I did. ("Caleb" is fine!) Re: modern definition, my point is that the modern notion of a program is very different from, say, Ada Lovelace's note G or the universal Turing machine currently surveyed under History. Explaining what a program is today and what it was historically are two very different things. About classification, I think it would be nice to overview some answers to the question: what are some of the ways that programs can be categorized? Those subsections are just some ideas. Caleb Stanford (talk) 22:17, 28 June 2022 (UTC)[reply]


  • The key sentence is, "Once the mechanics of basic computer programming are learned, more sophisticated and powerful languages are available to build large computer systems." Timhowardriley (talk) 22:15, 1 December 2022 (UTC)[reply]
  • The most profound passage is, "Object-oriented programming developed by combining the need for containers and the need for safe functional programming. This programming method need not be confined to an object-oriented language." Timhowardriley (talk) 10:25, 5 December 2022 (UTC)[reply]
  • The most difficult objective to achieve is, "To be effective, program modules need to be defined and distributed to team members. Also, team members must interact with one another in a meaningful and effective way." Timhowardriley (talk) 10:31, 5 December 2022 (UTC)[reply]
  • The most insightful sentence is, "C allows the programmer to control which region of memory data is to be stored." Timhowardriley (talk) 11:38, 5 December 2022 (UTC)[reply]
  • The "hodge podge" includes the sentence, "Software engineering is a variety of techniques to produce quality software." Timhowardriley (talk) 01:51, 12 February 2023 (UTC)[reply]
  • The "modern notion of a program is very different from, say, Ada Lovelace's note G" because "[a]t each stage in hardware's history, the task of computer programming changed dramatically." Timhowardriley (talk) 09:33, 12 February 2023 (UTC)[reply]
  • The "hello world" program in Basic at the beginning is is not "currently out of place" because "if a student didn't go on to a more powerful language, the student would still remember Basic." Timhowardriley (talk) 10:45, 22 February 2023 (UTC)[reply]
  • The "most unfortunate [inappropriate content is] the sprawling C++ code" which illustrates how "[i]n the 1970s, software engineers needed language support to break large projects down into modules. One obvious feature was to decompose large projects physically into separate files. A less obvious feature was to decompose large projects logically into abstract datatypes." Timhowardriley (talk) 12:59, 6 March 2023 (UTC)[reply]
    @Timhowardriley: With kindness, can you please stop editing the talk page of this article with non-constructive edits? I understand you disagree with the assessment of the article, but it doesn't help to repeatedly edit the talk page in this way. I also apologize if you took offense to the tone of my comments or felt that any of them are not actionable. My intention was to propose, in my view, how the article can be improved. Thanks, Caleb Stanford (talk) 04:42, 7 March 2023 (UTC)[reply]
    So far, this thread has successfully dissuaded any editor from trying to implement any of these substandard suggestions. Timhowardriley (talk) 11:00, 7 March 2023 (UTC)[reply]
    Follow up: an example of a quality suggestion would be, "Dr. Alpha from Bravo University wrote a computer textbook that has a chapter titled 'Program development'. In this chapter, software engineering and computer programming are discussed." Timhowardriley (talk) 12:51, 7 March 2023 (UTC)[reply]
    Tim, your posts have not successfully dissuaded any editor; nor do they attempt to substantively address any points that were raised. Your edits here are WP:DISRUPTIVE. They are non-constructive and do not engage with the criticism. Please do not continue this behavior.
    If you have any suggestions for how to improve the article in a different way, that is appropriate for the talk page. If you think the article is perfect as is, then simply let the page be. Caleb Stanford (talk) 16:51, 7 March 2023 (UTC)[reply]
  • Regarding About classification, I think it would be nice to overview some answers to the question: what are some of the ways that programs can be categorized?: The article currently describes a handful of program categories. They are: knobs and switches, first generation, second generation, third generation, fourth generation, imperative languages, declarative languages, functional languages, logical languages, object-oriented programs, application software, system software, utility programs, and microcode programs. What is your vision for an overview? Timhowardriley (talk) 17:32, 8 March 2023 (UTC)[reply]

Moved "program execution" template and top image to talk.

I'm moving the newly added "program execution" and the top image to this talk section.

Program vs. Process vs. Thread
Scheduling, Preemption, Context Switching

The "program execution" template is too large and negatively affects the article's format. The top image has interesting information, but too much of it. Also, the image should be split in two. There are two concepts present, and the joining of them is unclear. Timhowardriley (talk) 07:31, 10 June 2023 (UTC)[reply]

@Timhowardriley The distinction between "Program", "Process" and "Thread" and the steps that a line of "instruction code of program" is delivered to a CPU for processing is important. So in my opinion the image can be restored. That is, the image says "What happens that a CPU processes a program?". Thanks, Hooman Mallahzadeh (talk) 11:01, 10 June 2023 (UTC)[reply]
This edit to move the image to the OS section was a good idea. Timhowardriley (talk) 22:10, 14 June 2023 (UTC)[reply]

Prolog rewrite

This edit changed the Prolog section from material I could understand to material I cannot understand. This article is general purpose. It should explain computer programs at the most elementary level possible. The prior Prolog material was elementary. The current material is complicated. Was the prior material incorrect? Timhowardriley (talk) 20:22, 15 August 2023 (UTC)[reply]

Yes, unfortunately, the previous program was not correct. See the talk page for declarative programming. For example, the clauses cat(tom). animal(cat).are not correct Prolog. Robert Kowalski (talk) 21:24, 15 August 2023 (UTC)[reply]

Correct results for Prolog numeric grade example

The displayed results for Prolog's numeric grade example is not what the user would expect. The article says the results will display: X = 'A'. The expected results should display: X = 4. Timhowardriley (talk) 19:59, 16 August 2023 (UTC)[reply]

The example in its current form has two relations, which can be queried in isolation, or which can be queried in combination (like a join in a relational database). For example:
numeric_grade('A', 4).
numeric_grade('B', 3).
numeric_grade('C', 2).
numeric_grade('D', 1).
numeric_grade('F', 0).
numeric_grade(X, -1) :- not X = 'A', not X = 'B', not X = 'C', not X = 'D', not X = 'F'.
grade('The Student', 'A').
?- grade('The Student', X), numeric_grade(X, Y).
X = 'A',
Y = 4
Alternatively, the query could be used to define a new relation, which gives the grade of a student as a number:
numeric_grade('A', 4).
numeric_grade('B', 3).
numeric_grade('C', 2).
numeric_grade('D', 1).
numeric_grade('F', 0).
numeric_grade(X, -1) :- not X = 'A', not X = 'B', not X = 'C', not X = 'D', not X = 'F'.
grade_as_number(Student, Number) :- 
        grade(Student, Letter), numeric_grade(Letter, Number).
grade('The Student', 'A').
?- grade_as_number('The Student', Number).
Number = 4

Robert Kowalski (talk) 08:18, 18 August 2023 (UTC)[reply]

Followup: It would be nice to learn Prolog's syntax for forming functions. Could this example be converted to a function? If so, then how would the the driver program execute it? Timhowardriley (talk) 20:33, 16 August 2023 (UTC)[reply]

Here is the example in Ciao Prolog's functional syntax:
numeric_grade('A') := 4.
numeric_grade('B') := 3.
numeric_grade('C') := 2.
numeric_grade('D') := 1.
numeric_grade('F') := 0.
numeric_grade(X) := -1 :-  X \= 'A', X \= 'B', X \= 'C', X \= 'D', X \= 'F'.
grade_as_number(Student) := numeric_grade(grade(Student)).
grade('The Student') := 'A'.
grade(bob) := good.

?- ~grade_as_number(Student) = Number.
Number = 4,
Student = 'The Student' ;

Number = -1,
Student = bob
Just for fun, the query asks for all input-output pairs that satisfy the functional relationship "grade_as_number". Good for debugging.
Ciao executes the functional program by transforming it into the relational representation, with the value of the function as the last argument of the relation.

Prolog example use of word "clause"

The comprehensive example uses the word "clause" twice: "third clause" and "fourth clause". What are the first two clauses? Perhaps the clauses could be labeled in comments. Timhowardriley (talk) 12:33, 18 August 2023 (UTC)[reply]

Good idea. Thanks. Robert Kowalski (talk) 15:02, 18 August 2023 (UTC)[reply]

Prolog rule 4 a subclass or superclass?

@Robert Kowalski Rule 4) seems to define a superclass, not a subclass: A thing is a creature if the thing is a dragon:

is_a_creature(X) :-
    is_a_dragon(X).

Combining Rule 2) to Rule 4) constrains a creature to be a dragon if one parent is a dragon. I'm trying to wrap my head around the possibility of introducing a monster to the mix. A monster is a creature that doesn't billow fire.

is_a_monster(X) :-
    is_a_creature(X),
    not billows_fire(X).

Yet, the new rule would seem to contradict rule 4), unless rule 4) defines a superclass. Timhowardriley (talk) 00:54, 22 August 2023 (UTC)[reply]

@Timhowardriley Hm... You are right that rule 4 is not a definition of dragon as a subclass of creature. Nor is it a definition of creature as a superclass of dragon. At best, it is only a partial definition of the superclass creature, because there might be other creatures, such as monsters, which do not billow fire, and which therefore are not dragons. Good catch! Robert Kowalski (talk) 08:56, 22 August 2023 (UTC)[reply]

Illustration

#include <stdio.h>

int
main (void)
{
  puts ("Hello, world!");
}
A "Hello, World!" program in the influential programming language C

I just removed the image from the lead sentence of this article as I think it is quite uninformative. It's a stock-photo-like photo of HTML and JavaScript on a website, which, while it could be considered a computer programme, is hardly a prime example thereof. The formatting is also clearly for aesthetic rather than functional reasons, making it rather misrepresentative of how code actually looks. Now I'd like to discuss what if anything we should use to illustrate this article. I personally would probably prefer some kind of schematic representation, but I don't know if we have any good ones – one was removed above for being too complicated. Another option could be to include an {{image frame}} with some actual code, like to the right. We could include multiple languages to illustrate different paradigms. However, this may be going too much into the territory of programming languages, rather than the abstract conept of a computer programme. Any ideas? -- Maddy from Celeste (WAVEDASH) 17:10, 5 December 2023 (UTC)[reply]

True, the prior image worked as eye-candy (aesthetic reason). Perhaps this JavaScript eye-candy shows more function: [1]. Otherwise, the above image-frame works -- without the word "influential" in the caption. Maybe an image-frame of a JavaScript snippet is a good compromise. Timhowardriley (talk) 20:23, 5 December 2023 (UTC)[reply]
I wanted to try out the image frame thing because I assume it's better for accessibility and semantic Web, but I also realize an image can have certain advantages. I'd still like to explore the possibility of some simple conceptual illustration, but I'm not sure I'm the best qualified to say how one should illustrate this concept. Something I think we also should consider, is that most readers will not be interacting with programmes in source code form; that is not to say that a user interface is the best choice of image either, but maybe that speaks for a more conceptual illustration as well? -- Maddy from Celeste (WAVEDASH) 19:13, 6 December 2023 (UTC)[reply]

This article has major problems

First, it's waaaaaaaaaaaaaaaaaaaaaaaay too long. It seems try to cover everything known to man about software. Too much. Most of the content should be removed or moved to other pages.

Second, just focusing on the leader, it's way off base...

"It is one component of software, which also includes documentation and other intangible components" I guess not wrong seems lame and begs the question: what intangible components?

  • Hover over the citation to see the quote. The citation's quote says, "[Software includes] all or part of the programs, procedures, rules, and associated documentation of an information processing system." Procedures, rules, and associated documentation constitute intangible components. Timhowardriley (talk) 22:37, 5 February 2024 (UTC)[reply]

"A computer program in its human-readable form is called source code" yah. no. Programs _are_ executables –} machine code. They are not human-readable. The source code from which you build a program is not a program.

"language's compiler" Languages don't have compilers. A compiler is for a certain language; compiles code of a certain language.

"source code may execute within the language's interpreter." nope. The interpreter is a program. The source code that it runs is simply input; not a program itself. Interpreted source code is sometimes called a script – which is similar to a program but has the special distinction that it's not compiled; is human readable.

"If the executable is requested for execution, then the operating system loads it into memory and starts a process. The central processing unit will soon switch to this process so it can fetch, decode, and then execute each machine instruction." not wrong, but very ham-handed. How about: Generally, the operating system copies a program from permanent storage into memory (i.e. RAM) and starts executing its instructions, starting at the entry point, as what is called a process. The OS executes instructions in sequence and sometimes in parallel with conditional branching logic that directs the flow of logic. In some cases, a program is run directly from permanent storage – without copying instructions to RAM.

  • All of your criticisms are with the lead section, where a lot of thought went into every sentence. The lead section is not intended to be fully nuanced. It is just generalities, and the rest of the article drills down to the details. Timhowardriley (talk) 22:37, 5 February 2024 (UTC)[reply]

Stevebroshar (talk) 20:33, 5 February 2024 (UTC)[reply]