SUPPORT THE WORK

GetWiki

Computer program

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Computer program
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Short description|Instructions to be executed by a computer}}{{for|the TV program|The Computer Programme{{!}}The Computer Programme}}File:JavaScript_code.png|thumb|Source code for a computer program written in the JavaScriptJavaScriptA computer program is a sequence or set{{efn|The Prolog language allows for a database of facts and rules to be entered in any order. However, a question about a database must be at the very end.}} of instructions in a programming language for a computer to execute. It is one component of software, which also includes documentation and other intangible components.WEB
, ISO/IEC 2382:2015
, ISO
, 2020-09-03
,weblink
, 2022-05-26
, [Software includes] all or part of the programs, procedures, rules, and associated documentation of an information processing system.
, 2016-06-17
,weblink
, live
,
A computer program in its human-readable form is called source code. Source code needs another computer program to execute because computers can only execute their native machine instructions. Therefore, source code may be translated to machine instructions using a compiler written for the language. (Assembly language programs are translated using an assembler.) The resulting file is called an executable. Alternatively, source code may execute within an interpreter written for the language.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 7
, An alternative to compiling a source program is to use an interpreter. An interpreter can directly execute a source program[.]
, 0-201-71012-9
, If the executable is requested for execution, then the operating system loads it into memory and starts a process.BOOK
, Silberschatz
, Abraham
, Operating System Concepts, Fourth Edition
, Addison-Wesley
, 1994
, 98
, 978-0-201-50480-4
, The central processing unit will soon switch to this process so it can fetch, decode, and then execute each machine instruction.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 32
, 978-0-13-854662-5
,weblink
,
If the source code is requested for execution, then the operating system loads the corresponding interpreter into memory and starts a process. The interpreter then loads the source code into memory to translate and execute each statement. Running the source code is slower than running an executable.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 7
, 0-201-71012-9
, {{efn|An executable has each machine instruction ready for the CPU.}} Moreover, the interpreter must be installed on the computer.

Example computer program

The "Hello, World!" program is used to illustrate a language's basic syntax. The syntax of the language BASIC (1964) was intentionally limited to make the language easy to learn.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 30
, 0-201-71012-9
, Their intention was to produce a language that was very simple for students to learn[.]
, For example, variables are not declared before being used.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 31
, 0-201-71012-9
, Also, variables are automatically initialized to zero. Here is an example computer program, in Basic, to average a list of numbers:BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 30
, 0-201-71012-9
, 10 INPUT "How many numbers to average?", A20 FOR I = 1 TO A30 INPUT "Enter number:", B40 LET C = C + B50 NEXT I60 LET D = C/A70 PRINT "The average is", D80 ENDOnce the mechanics of basic computer programming are learned, more sophisticated and powerful languages are available to build large computer systems.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 30
, 0-201-71012-9
, The idea was that students could be merely casual users or go on from Basic to more sophisticated and powerful languages[.]
,

History

{{See also|Computer programming#History|Programmer#History|History of computing|History of programming languages|History of software}}Improvements in software development are the result of improvements in computer hardware. At each stage in hardware's history, the task of computer programming changed dramatically.

Analytical Engine

(File:Diagram for the computation of Bernoulli numbers.jpg|thumb|right|Lovelace's description from Note G)In 1837, Jacquard's loom inspired Charles Babbage to attempt to build the Analytical Engine.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 16
, 978-0-8027-1348-3
,weblink
,
The names of the components of the calculating device were borrowed from the textile industry. In the textile industry, yarn was brought from the store to be milled. The device had a "store" which consisted of memory to hold 1,000 numbers of 50 decimal digits each.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 14
, 978-0-13-854662-5
,weblink
, Numbers from the "store" were transferred to the "mill" for processing. It was programmed using two sets of perforated cards. One set directed the operation and the other set inputted the variables.JOURNAL
, Allan G.
, Bromley
, Allan G. Bromley
, 1998
,weblink
, Charles Babbage's Analytical Engine, 1838
, IEEE Annals of the History of Computing
, 20
, 4
, 29–45
, 10.1109/85.728228
, 2285332
, 2015-10-30
, 2016-03-04
,weblink" title="web.archive.org/web/20160304081812weblink">weblink
, live
, However, the thousands of cogged wheels and gears never fully worked together.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 15
, 978-0-13-854662-5
,weblink
,
Ada Lovelace worked for Charles Babbage to create a description of the Analytical Engine (1843).{{citation
|author1 = J. Fuegi
|author2 =J. Francis
|title = Lovelace & Babbage and the creation of the 1843 'notes'
|journal = Annals of the History of Computing
|volume = 25
|issue = 4
|date=October–December 2003
|doi = 10.1109/MAHC.2003.1253887
|pages = 16, 19, 25}} The description contained Note G which completely detailed a method for calculating Bernoulli numbers using the Analytical Engine. This note is recognized by some historians as the world's first computer program.

Universal Turing machine

(File:Universal Turing machine.svg|350px|right)In 1936, Alan Turing introduced the Universal Turing machine, a theoretical device that can model every computation.BOOK
, Rosen
, Kenneth H.
, Discrete Mathematics and Its Applications
, McGraw-Hill, Inc.
, 1991
, 654
, 978-0-07-053744-6
,weblink
, Turing machines can model all the computations that can be performed on a computing machine.
,
It is a finite-state machine that has an infinitely long read/write tape. The machine can move the tape back and forth, changing its contents as it performs an algorithm. The machine starts in the initial state, goes through a sequence of steps, and halts when it encounters the halt state.BOOK
, Linz
, Peter
, An Introduction to Formal Languages and Automata
, D. C. Heath and Company
, 1990
, 234
, 978-0-669-17342-0
, All present-day computers are Turing complete.BOOK
, Linz
, Peter
, An Introduction to Formal Languages and Automata
, D. C. Heath and Company
, 1990
, 243
, 978-0-669-17342-0
, [A]ll the common mathematical functions, no matter how complicated, are Turing-computable.
,

ENIAC

(File:ENIAC-changing_a_tube.jpg|thumb|right|Glenn A. Beck changing a tube in ENIAC)The Electronic Numerical Integrator And Computer (ENIAC) was built between July 1943 and Fall 1945. It was a Turing complete, general-purpose computer that used 17,468 vacuum tubes to create the circuits. At its core, it was a series of Pascalines wired together.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 102
, 978-0-8027-1348-3
,weblink
, Its 40 units weighed 30 tons, occupied {{convert|1,800|sqft|m2|0}}, and consumed $650 per hour (in 1940s currency) in electricity when idle. It had 20 base-10 accumulators. Programming the ENIAC took up to two months. Three function tables were on wheels and needed to be rolled to fixed function panels. Function tables were connected to function panels by plugging heavy black cables into plugboards. Each function table had 728 rotating knobs. Programming the ENIAC also involved setting some of the 3,000 switches. Debugging a program took a week.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 94
, 978-0-8027-1348-3
,weblink
, It ran from 1947 until 1955 at Aberdeen Proving Ground, calculating hydrogen bomb parameters, predicting weather patterns, and producing firing tables to aim artillery guns.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 107
, 978-0-8027-1348-3
,weblink
,

Stored-program computers

Instead of plugging in cords and turning switches, a stored-program computer loads its instructions into memory just like it loads its data into memory.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 120
, 978-0-8027-1348-3
,weblink
, As a result, the computer could be programmed quickly and perform calculations at very fast speeds.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 118
, 978-0-8027-1348-3
,weblink
, Presper Eckert and John Mauchly built the ENIAC. The two engineers introduced the stored-program concept in a three-page memo dated February 1944.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 119
, 978-0-8027-1348-3
,weblink
, Later, in September 1944, John von Neumann began working on the ENIAC project. On June 30, 1945, von Neumann published the First Draft of a Report on the EDVAC, which equated the structures of the computer with the structures of the human brain. The design became known as the von Neumann architecture. The architecture was simultaneously deployed in the constructions of the EDVAC and EDSAC computers in 1949.BOOK
, McCartney
, Scott
, ENIAC – The Triumphs and Tragedies of the World's First Computer
, Walker and Company
, 1999
, 123
, 978-0-8027-1348-3
,weblink
,
The IBM System/360 (1964) was a family of computers, each having the same instruction set architecture. The Model 20 was the smallest and least expensive. Customers could upgrade and retain the same application software.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 21
, 978-0-13-854662-5
,weblink
, registration
, The Model 195 was the most premium. Each System/360 model featured multiprogramming—having multiple processes in memory at once. When one process was waiting for input/output, another could compute.
IBM planned for each model to be programmed using PL/1.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 27
, 0-201-71012-9
, A committee was formed that included COBOL, Fortran and ALGOL programmers. The purpose was to develop a language that was comprehensive, easy to use, extendible, and would replace Cobol and Fortran. The result was a large and complex language that took a long time to compile.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 29
, 0-201-71012-9
, File:Dg-nova3.jpg|thumb|Switches for manual input on a Data General NovaData General NovaComputers manufactured until the 1970s had front-panel switches for manual programming.BOOK
, Silberschatz
, Abraham
, Operating System Concepts, Fourth Edition
, Addison-Wesley
, 1994
, 6
, 978-0-201-50480-4
, The computer program was written on paper for reference. An instruction was represented by a configuration of on/off settings. After setting the configuration, an execute button was pressed. This process was then repeated. Computer programs also were automatically inputted via paper tape, punched cards or magnetic-tape. After the medium was loaded, the starting address was set via switches, and the execute button was pressed.

Very Large Scale Integration

missing image!
- Diopsis.jpg -
A VLSI integrated-circuit die
A major milestone in software development was the invention of the Very Large Scale Integration (VLSI) circuit (1964).WEB
,weblink
, Bill Pentz — A bit of Background: the Post-War March to VLSI
, Digibarn Computer Museum
, August 2008
, January 31, 2022
, March 21, 2022
,weblink
, live
, Following World War II, tube-based technology was replaced with point-contact transistors (1947) and bipolar junction transistors (late 1950s) mounted on a circuit board. During the 1960s, the aerospace industry replaced the circuit board with an integrated circuit chip.
Robert Noyce, co-founder of Fairchild Semiconductor (1957) and Intel (1968), achieved a technological improvement to refine the production of field-effect transistors (1963).BOOK
,weblink
, To the Digital Age: Research Labs, Start-up Companies, and the Rise of MOS
, Johns Hopkins University Press
, 2002
, 9780801886393
, February 3, 2022
, February 2, 2023
,weblink
, live
, The goal is to alter the electrical resistivity and conductivity of a semiconductor junction. First, naturally occurring silicate minerals are converted into polysilicon rods using the Siemens process.WEB
,weblink
, Manufacturing of Silicon Materials for Microelectronics and Solar PV
, Sandia National Laboratories
, 2017
, February 8, 2022
, Chalamala
, Babu
, March 23, 2023
,weblink
, live
, The Czochralski process then converts the rods into a monocrystalline silicon, boule crystal.WEB
,weblink
, Fabricating ICs Making a base wafer
, Britannica
, February 8, 2022
, February 8, 2022
,weblink
, live
, The crystal is then thinly sliced to form a wafer substrate. The planar process of photolithography then integrates unipolar transistors, capacitors, diodes, and resistors onto the wafer to build a matrix of metal–oxide–semiconductor (MOS) transistors.WEB
,weblink
, Introduction to NMOS and PMOS Transistors
, 4 November 2021
, Anysilicon
, February 5, 2022
, 6 February 2022
,weblink
, live
, WEB
,weblink
, microprocessor definition
, Britannica
, April 1, 2022
, April 1, 2022
,weblink
, live
, The MOS transistor is the primary component in integrated circuit chips.
Originally, integrated circuit chips had their function set during manufacturing. During the 1960s, controlling the electrical flow migrated to programming a matrix of read-only memory (ROM). The matrix resembled a two-dimensional array of fuses. The process to embed instructions onto the matrix was to burn out the unneeded connections. There were so many connections, firmware programmers wrote a computer program on another chip to oversee the burning. The technology became known as Programmable ROM. In 1971, Intel installed the computer program onto the chip and named it the Intel 4004 microprocessor.WEB
,weblink
, Chip Hall of Fame: Intel 4004 Microprocessor
, Institute of Electrical and Electronics Engineers
, July 2, 2018
, January 31, 2022
, February 7, 2022
,weblink
, live
,
missing image!
- Slt1.jpg -
IBM's System/360 (1964) CPU was not a microprocessor.
The terms microprocessor and central processing unit (CPU) are now used interchangeably. However, CPUs predate microprocessors. For example, the IBM System/360 (1964) had a CPU made from circuit boards containing discrete components on ceramic substrates.WEB
,weblinkweblink 2022-10-10, live
, 360 Revolution
, Father, Son & Co.
, 1990
, February 5, 2022
,

Sac State 8008

(File:Sacstate 8008.jpg|thumb|Artist's depiction of Sacramento State University's Intel 8008 microcomputer (1972))The Intel 4004 (1971) was a 4-bit microprocessor designed to run the Busicom calculator. Five months after its release, Intel released the Intel 8008, an 8-bit microprocessor. Bill Pentz led a team at Sacramento State to build the first microcomputer using the Intel 8008: the Sac State 8008 (1972).WEB
,weblink
, Inside the world's long-lost first microcomputer
, c/net
, January 8, 2010
, January 31, 2022
, February 1, 2022
,weblink
, live
, Its purpose was to store patient medical records. The computer supported a disk operating system to run a Memorex, 3-megabyte, hard disk drive. It had a color display and keyboard that was packaged in a single console. The disk operating system was programmed using IBM's Basic Assembly Language (BAL). The medical records application was programmed using a BASIC interpreter. However, the computer was an evolutionary dead-end because it was extremely expensive. Also, it was built at a public university lab for a specific purpose. Nonetheless, the project contributed to the development of the Intel 8080 (1974) instruction set.

x86 series

File:IBM_PC-IMG_7271_(transparent).png|thumb|right|The original IBM Personal ComputerIBM Personal ComputerIn 1978, the modern software development environment began when Intel upgraded the Intel 8080 to the Intel 8086. Intel simplified the Intel 8086 to manufacture the cheaper Intel 8088.WEB
,weblink
, Bill Gates, Microsoft and the IBM Personal Computer
, InfoWorld
, August 23, 1982
, 1 February 2022
, 18 February 2023
,weblink
, live
, IBM embraced the Intel 8088 when they entered the personal computer market (1981). As consumer demand for personal computers increased, so did Intel's microprocessor development. The succession of development is known as the x86 series. The x86 assembly language is a family of backward-compatible machine instructions. Machine instructions created in earlier microprocessors were retained throughout microprocessor upgrades. This enabled consumers to purchase new computers without having to purchase new application software. The major categories of instructions are:{{efn|For more information, visit X86 assembly language#Instruction types.}}

Changing programming environment

File:DEC VT100 terminal transparent.png|thumb|right|The DEC VT100 (1978) was a widely used computer terminalcomputer terminalVLSI circuits enabled the programming environment to advance from a computer terminal (until the 1990s) to a graphical user interface (GUI) computer. Computer terminals limited programmers to a single shell running in a command-line environment. During the 1970s, full-screen source code editing became possible through a text-based user interface. Regardless of the technology available, the goal is to program in a programming language.

Programming paradigms and languages

Programming language features exist to provide building blocks to be combined to express programming ideals.BOOK
, Stroustrup
, Bjarne
, The C++ Programming Language, Fourth Edition
, Addison-Wesley
, 2013
, 10
, 978-0-321-56384-2
, Ideally, a programming language should:
  • express ideas directly in the code.
  • express independent ideas independently.
  • express relationships among ideas directly in the code.
  • combine ideas freely.
  • combine ideas only where combinations make sense.
  • express simple ideas simply.
The programming style of a programming language to provide these building blocks may be categorized into programming paradigms.BOOK
, Stroustrup
, Bjarne
, The C++ Programming Language, Fourth Edition
, Addison-Wesley
, 2013
, 11
, 978-0-321-56384-2
, For example, different paradigms may differentiate: Each of these programming styles has contributed to the synthesis of different programming languages.A programming language is a set of keywords, symbols, identifiers, and rules by which programmers can communicate instructions to the computer.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 159
, 0-619-06489-7
, They follow a set of rules called a syntax. Programming languages get their basis from formal languages.BOOK
, Linz
, Peter
, An Introduction to Formal Languages and Automata
, D. C. Heath and Company
, 1990
, 2
, 978-0-669-17342-0
, The purpose of defining a solution in terms of its formal language is to generate an algorithm to solve the underlining problem. An algorithm is a sequence of simple instructions that solve a problem.BOOK
, Weiss
, Mark Allen
, Data Structures and Algorithm Analysis in C++
, Benjamin/Cummings Publishing Company, Inc.
, 1994
, 29
, 0-8053-5443-3
,

Generations of programming language

The evolution of programming language began when the EDSAC (1949) used the first stored computer program in its von Neumann architecture.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 17
, 978-0-13-854662-5
,weblink
, Programming the EDSAC was in the first generation of programming language.


, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 160
, 0-619-06489-7
, Machine language requires the programmer to enter instructions using instruction numbers called machine code. For example, the ADD operation on the PDP-11 has instruction number 24576.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 399
, 978-0-13-854662-5
,weblink
,
  • The second generation of programming language is assembly language. Assembly language allows the programmer to use mnemonic instructions instead of remembering instruction numbers. An assembler translates each assembly language mnemonic into its machine language number. For example, on the PDP-11, the operation 24576 can be referenced as ADD in the source code. The four basic arithmetic operations have assembly instructions like ADD, SUB, MUL, and DIV. Computers also have instructions like DW (Define Word) to reserve memory cells. Then the MOV instruction can copy integers between registers and memory.


* The basic structure of an assembly language statement is a label, operation, operand, and comment.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 400
, 978-0-13-854662-5
,weblink
,


* Labels allow the programmer to work with variable names. The assembler will later translate labels into physical memory addresses. * Operations allow the programmer to work with mnemonics. The assembler will later translate mnemonics into instruction numbers. * Operands tell the assembler which data the operation will process. * Comments allow the programmer to articulate a narrative because the instructions alone are vague. The key characteristic of an assembly language program is it forms a one-to-one mapping to its corresponding machine language target.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Third Edition
, Prentice Hall
, 1990
, 398
, 978-0-13-854662-5
,weblink
,


, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 26
, 0-201-71012-9
, Early languages include Fortran (1958), COBOL (1959), ALGOL (1960), and BASIC (1964). In 1973, the C programming language emerged as a high-level language that produced efficient machine language instructions.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 37
, 0-201-71012-9
, Whereas third-generation languages historically generated many machine instructions for each statement,BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 160
, 0-619-06489-7
, With third-generation and higher-level programming languages, each statement in the language translates into several instructions in machine language.
, C has statements that may generate a single machine instruction.{{efn|Operators like x++ will usually compile to a single instruction.}} Moreover, an optimizing compiler might overrule the programmer and produce fewer machine instructions than statements. Today, an entire paradigm of languages fill the imperative, third generation spectrum.
  • The fourth generation of programming language emphasizes what output results are desired, rather than how programming statements should be constructed. Declarative languages attempt to limit side effects and allow programmers to write code with relatively few errors. One popular fourth generation language is called Structured Query Language (SQL). Database developers no longer need to process each database record one at a time. Also, a simple statement can generate output records without having to understand how they are retrieved.

Imperative languages

(File:Object-Oriented-Programming-Methods-And-Classes-with-Inheritance.png|thumb|A computer program written in an imperative language)Imperative languages specify a sequential algorithm using declarations, expressions, and statements:BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Second Edition
, Addison-Wesley
, 1993
, 75
, 978-0-201-56885-1
,
  • A declaration introduces a variable name to the computer program and assigns it to a datatypeBOOK


, Stroustrup
, Bjarne
, The C++ Programming Language, Fourth Edition
, Addison-Wesley
, 2013
, 40
, 978-0-321-56384-2
, – for example: var x: integer;
  • An expression yields a value – for example: 2 + 2 yields 4
  • A statement might assign an expression to a variable or use the value of a variable to alter the program's control flow – for example: x := 2 + 2; if x = 4 then do_something();

Fortran

FORTRAN (1958) was unveiled as "The IBM Mathematical FORmula TRANslating system." It was designed for scientific calculations, without string handling facilities. Along with declarations, expressions, and statements, it supported: It succeeded because:
  • programming and debugging costs were below computer running costs.
  • it was supported by IBM.
  • applications at the time were scientific.BOOK


, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 16
, 0-201-71012-9
, However, non-IBM vendors also wrote Fortran compilers, but with a syntax that would likely fail IBM's compiler. The American National Standards Institute (ANSI) developed the first Fortran standard in 1966. In 1978, Fortran 77 became the standard until 1991. Fortran 90 supports:

COBOL

COBOL (1959) stands for "COmmon Business Oriented Language." Fortran manipulated symbols. It was soon realized that symbols did not need to be numbers, so strings were introduced.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 24
, 0-201-71012-9
, The US Department of Defense influenced COBOL's development, with Grace Hopper being a major contributor. The statements were English-like and verbose. The goal was to design a language so managers could read the programs. However, the lack of structured statements hindered this goal.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 25
, 0-201-71012-9
, COBOL's development was tightly controlled, so dialects did not emerge to require ANSI standards. As a consequence, it was not changed for 15 years until 1974. The 1990s version did make consequential changes, like object-oriented programming.

Algol

ALGOL (1960) stands for "ALGOrithmic Language." It had a profound influence on programming language design.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 19
, 0-201-71012-9
, Emerging from a committee of European and American programming language experts, it used standard mathematical notation and had a readable, structured design. Algol was first to define its syntax using the Backus–Naur form. This led to syntax-directed compilers. It added features like: Algol's direct descendants include Pascal, Modula-2, Ada, Delphi and Oberon on one branch. On another branch the descendants include C, C++ and Java.

Basic

BASIC (1964) stands for "Beginner's All-Purpose Symbolic Instruction Code." It was developed at Dartmouth College for all of their students to learn. If a student did not go on to a more powerful language, the student would still remember Basic. A Basic interpreter was installed in the microcomputers manufactured in the late 1970s. As the microcomputer industry grew, so did the language.Basic pioneered the interactive session. It offered operating system commands within its environment:
  • The 'new' command created an empty slate.
  • Statements evaluated immediately.
  • Statements could be programmed by preceding them with a line number.
  • The 'list' command displayed the program.
  • The 'run' command executed the program.
However, the Basic syntax was too simple for large programs. Recent dialects added structure and object-oriented extensions. Microsoft's Visual Basic is still widely used and produces a graphical user interface.

C

C programming language (1973) got its name because the language BCPL was replaced with B, and AT&T Bell Labs called the next version "C." Its purpose was to write the UNIX operating system. C is a relatively small language, making it easy to write compilers. Its growth mirrored the hardware growth in the 1980s. Its growth also was because it has the facilities of assembly language, but uses a high-level syntax. It added advanced features like: (File:Computer-memory-map.png|thumb|right|Computer memory map)C allows the programmer to control which region of memory data is to be stored. Global variables and static variables require the fewest clock cycles to store. The stack is automatically used for the standard variable declarations. Heap memory is returned to a pointer variable from the malloc() function.
  • The global and static data region is located just above the program region. (The program region is technically called the text region. It is where machine instructions are stored.)


* The global and static data region is technically two regions.WEB,weblink Memory Layout of C Programs, 12 September 2011, 6 November 2021, 6 November 2021,weblink live
, One region is called the initialized data segment, where variables declared with default values are stored. The other region is called the block started by segment, where variables declared without default values are stored.
* Variables stored in the global and static data region have their addresses set at compile-time. They retain their values throughout the life of the process.
* The global and static region stores the global variables that are declared on top of (outside) the main() function.BOOK
, The C Programming Language Second Edition
, Kernighan
, Brian W.
, Ritchie
, Dennis M.
, Prentice Hall
, 1988
, 0-13-110362-8
, 31, Global variables are visible to main() and every other function in the source code.


On the other hand, variable declarations inside of main(), other functions, or within { } block delimiters are local variables. Local variables also include formal parameter variables. Parameter variables are enclosed within the parenthesis of function definitions.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 128
, 0-201-71012-9
, They provide an interface to the function.
* Local variables declared using the static prefix are also stored in the global and static data region. Unlike global variables, static variables are only visible within the function or block. Static variables always retain their value. An example usage would be the function int increment_counter(){static int counter = 0; counter++; return counter;}{{efn|This function could be written more concisely as int increment_counter(){ static int counter; return ++counter;}. 1) Static variables are automatically initialized to zero. 2) ++counter is a prefix increment operator.}}
  • The stack region is a contiguous block of memory located near the top memory address.BOOK


, The Linux Programming Interface
, Kerrisk
, Michael
, No Starch Press
, 2010
, 978-1-59327-220-3
, 121, Variables placed in the stack are populated from top to bottom.{{efn|This is despite the metaphor of a stack, which normally grows from bottom to top.}} A stack pointer is a special-purpose register that keeps track of the last memory address populated. Variables are placed into the stack via the assembly language PUSH instruction. Therefore, the addresses of these variables are set during runtime. The method for stack variables to lose their scope is via the POP instruction.


* Local variables declared without the static prefix, including formal parameter variables,BOOK
, The Linux Programming Interface
, Kerrisk
, Michael
, No Starch Press
, 2010
, 978-1-59327-220-3
, 122, are called automatic variables and are stored in the stack. They are visible inside the function or block and lose their scope upon exiting the function or block.
  • The heap region is located below the stack. It is populated from the bottom to the top. The operating system manages the heap using a heap pointer and a list of allocated memory blocks.BOOK


, The C Programming Language Second Edition
, Kernighan
, Brian W.
, Ritchie
, Dennis M.
, Prentice Hall
, 1988
, 0-13-110362-8
, 185, Like the stack, the addresses of heap variables are set during runtime. An out of memory error occurs when the heap pointer and the stack pointer meet.


* C provides the malloc() library function to allocate heap memory.BOOK
, The C Programming Language Second Edition
, Kernighan
, Brian W.
, Ritchie
, Dennis M.
, Prentice Hall
, 1988
, 0-13-110362-8
, 187, Populating the heap with data is an additional copy function. Variables stored in the heap are economically passed to functions using pointers. Without pointers, the entire block of data would have to be passed to the function via the stack.

C++

In the 1970s, software engineers needed language support to break large projects down into modules.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 38
, 0-201-71012-9
, One obvious feature was to decompose large projects physically into separate files. A less obvious feature was to decompose large projects logically into abstract data types. At the time, languages supported concrete (scalar) datatypes like integer numbers, floating-point numbers, and strings of characters. Abstract datatypes are structures of concrete datatypes, with a new name assigned. For example, a list of integers could be called integer_list.In object-oriented jargon, abstract datatypes are called classes. However, a class is only a definition; no memory is allocated. When memory is allocated to a class and bound to an identifier, it is called an object.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 193
, 0-201-71012-9
, Object-oriented imperative languages developed by combining the need for classes and the need for safe functional programming.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 39
, 0-201-71012-9
, A function, in an object-oriented language, is assigned to a class. An assigned function is then referred to as a method, member function, or operation. Object-oriented programming is executing operations on objects.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 35
, 0-201-71012-9
, Object-oriented languages support a syntax to model subset/superset relationships. In set theory, an element of a subset inherits all the attributes contained in the superset. For example, a student is a person. Therefore, the set of students is a subset of the set of persons. As a result, students inherit all the attributes common to all persons. Additionally, students have unique attributes that other people do not have. Object-oriented languages model subset/superset relationships using inheritance.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 192
, 0-201-71012-9
, Object-oriented programming became the dominant language paradigm by the late 1990s.C++ (1985) was originally called "C with Classes."BOOK
, Stroustrup
, Bjarne
, The C++ Programming Language, Fourth Edition
, Addison-Wesley
, 2013
, 22
, 978-0-321-56384-2
, It was designed to expand C's capabilities by adding the object-oriented facilities of the language Simula.BOOK
, Stroustrup
, Bjarne
, The C++ Programming Language, Fourth Edition
, Addison-Wesley
, 2013
, 21
, 978-0-321-56384-2
, An object-oriented module is composed of two files. The definitions file is called the header file. Here is a C++ header file for the GRADE class in a simple school application:// grade.h// ---
// Used to allow multiple source files to include// this header file without duplication errors.// ------------------------------------------
#ifndef GRADE_H
  1. define GRADE_H
class GRADE {public:
// This is the constructor operation.
// ------------------------------
GRADE ( const char letter );


// This is a class variable.
// ---------------------
char letter;


// This is a member operation.
// -----------------------
int grade_numeric( const char letter );


// This is a class variable.
// ---------------------
int numeric;
};
  1. endif
A constructor operation is a function with the same name as the class name.BOOK
, Stroustrup
, Bjarne
, The C++ Programming Language, Fourth Edition
, Addison-Wesley
, 2013
, 49
, 978-0-321-56384-2
, It is executed when the calling operation executes the new statement.A module's other file is the source file. Here is a C++ source file for the GRADE class in a simple school application:// grade.cpp// -----
#include "grade.h"GRADE::GRADE( const char letter ){
// Reference the object using the keyword 'this'.
// ------------------------------------------
this->letter = letter;


// This is Temporal Cohesion
// ---------------------
this->numeric = grade_numeric( letter );
}int GRADE::grade_numeric( const char letter ){
if ( ( letter == 'A' || letter == 'a' ) )
return 4;
else
if ( ( letter == 'B' || letter == 'b' ) )
return 3;
else
if ( ( letter == 'C' || letter == 'c' ) )
return 2;
else
if ( ( letter == 'D' || letter == 'd' ) )
return 1;
else
if ( ( letter == 'F' || letter == 'f' ) )
return 0;
else
return -1;
}Here is a C++ header file for the PERSON class in a simple school application:// person.h// ----
#ifndef PERSON_H
  1. define PERSON_H
class PERSON {public:
PERSON ( const char *name );
const char *name;
};
  1. endif
Here is a C++ source file for the PERSON class in a simple school application:// person.cpp// ------
#include "person.h"PERSON::PERSON ( const char *name ){
this->name = name;
}Here is a C++ header file for the STUDENT class in a simple school application:// student.h// -----
#ifndef STUDENT_H
  1. define STUDENT_H
  1. include "person.h"
  2. include "grade.h"
// A STUDENT is a subset of PERSON.// ----------------------------
class STUDENT : public PERSON{public:
STUDENT ( const char *name );
GRADE *grade;
};
  1. endif
Here is a C++ source file for the STUDENT class in a simple school application:// student.cpp// -------
#include "student.h"
  1. include "person.h"
STUDENT::STUDENT ( const char *name ):
// Execute the constructor of the PERSON superclass.
// ---------------------------------------------
PERSON( name )
{
// Nothing else to do.
// ---------------
}
Here is a driver program for demonstration:// student_dvr.cpp// -----------
#include
  1. include "student.h"
int main( void ){
STUDENT *student = new STUDENT( "The Student" );
student->grade = new GRADE( 'a' );


std::cout
// Notice student inherits PERSON's name
name
numeric
letter = letter;
return grade;
}int grade_numeric( char letter ){
if ( ( letter == 'A' || letter == 'a' ) )
return 4;
else
if ( ( letter == 'B' || letter == 'b' ) )
return 3;
else
if ( ( letter == 'C' || letter == 'c' ) )
return 2;
else
if ( ( letter == 'D' || letter == 'd' ) )
return 1;
else
if ( ( letter == 'F' || letter == 'f' ) )
return 0;
else
return -1;
}In the constructor, the function calloc() is used instead of malloc() because each memory cell will be set to zero.Here is a C programming language header file for the PERSON abstract datatype in a simple school application:/* person.h *//* -------- */
  1. ifndef PERSON_H
  2. define PERSON_H
typedef struct{
char *name;
} PERSON;/* Constructor *//* ----------- */PERSON *person_new( char *name );
  1. endif
Here is a C programming language source file for the PERSON abstract datatype in a simple school application:/* person.c *//* -------- */
  1. include "person.h"
PERSON *person_new( char *name ){
PERSON *person;


if ( ! ( person = calloc( 1, sizeof ( PERSON ) ) ) )
{
fprintf(stderr,
"ERROR in %s/%s/%d: calloc() returned empty.n",
__FILE__,
__FUNCTION__,
__LINE__ );
exit( 1 );
}


person->name = name;
return person;
}Here is a C programming language header file for the STUDENT abstract datatype in a simple school application:/* student.h *//* --------- */
  1. ifndef STUDENT_H
  2. define STUDENT_H
  1. include "person.h"
  2. include "grade.h"
typedef struct{
/* A STUDENT is a subset of PERSON. */
/* -------------------------------- */
PERSON *person;


GRADE *grade;
} STUDENT;/* Constructor *//* ----------- */STUDENT *student_new( char *name );
  1. endif
Here is a C programming language source file for the STUDENT abstract datatype in a simple school application:/* student.c *//* --------- */
  1. include "student.h"
  2. include "person.h"
STUDENT *student_new( char *name ){
STUDENT *student;


if ( ! ( student = calloc( 1, sizeof ( STUDENT ) ) ) )
{
fprintf(stderr,
"ERROR in %s/%s/%d: calloc() returned empty.n",
__FILE__,
__FUNCTION__,
__LINE__ );
exit( 1 );
}


/* Execute the constructor of the PERSON superclass. */
/* ------------------------------------------------- */
student->person = person_new( name );
return student;
}Here is a driver program for demonstration:/* student_dvr.c *//* ------------- */
  1. include
  2. include "student.h"
int main( void ){
STUDENT *student = student_new( "The Student" );
student->grade = grade_new( 'a' );


printf( "%s: Numeric grade = %dn",
/* Whereas a subset exists, inheritance does not. */
student->person->name,
/* Functional programming is executing functions just-in-time (JIT) */
grade_numeric( student->grade->letter ) );
return 0;}Here is a makefile to compile everything:
  1. makefile
  2. ----
    all: student_dvr
clean:
rm student_dvr *.o
student_dvr: student_dvr.c grade.o student.o person.o
gcc student_dvr.c grade.o student.o person.o -o student_dvr
grade.o: grade.c grade.h
gcc -c grade.c
student.o: student.c student.h
gcc -c student.c
person.o: person.c person.h
gcc -c person.c
The formal strategy to build object-oriented objects is to:BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 285
, 0-256-08515-3
,
  • Identify the objects. Most likely these will be nouns.
  • Identify each object's attributes. What helps to describe the object?
  • Identify each object's actions. Most likely these will be verbs.
  • Identify the relationships from object to object. Most likely these will be verbs.
For example:
  • A person is a human identified by a name.
  • A grade is an achievement identified by a letter.
  • A student is a person who earns a grade.

Syntax and semantics

(File:Terminal and non-terminal symbols example.png|300px|thumb|right|Production rules consist of a set of terminals and non-terminals.)The syntax of a programming language is a list of production rules which form its grammar.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 290
, The syntax (or grammar) of a programming language describes the correct form in which programs may be written[.]
, 0-201-71012-9
, A programming language's grammar correctly places its declarations, expressions, and statements.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 78
, 0-201-71012-9
, The main components of an imperative language are declarations, expressions, and statements.
, Complementing the syntax of a language are its semantics. The semantics describe the meanings attached to various syntactic constructs.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 290
, 0-201-71012-9
, A syntactic construct may need a semantic description because a production rule may have an invalid interpretation.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 294
, 0-201-71012-9
, Also, different languages might have the same syntax; however, their behaviors may be different.The syntax of a language is formally described by listing the production rules. Whereas the syntax of a natural language is extremely complicated, a subset of the English language can have this production rule listing:BOOK
, Rosen
, Kenneth H.
, Discrete Mathematics and Its Applications
, McGraw-Hill, Inc.
, 1991
, 615
, 978-0-07-053744-6
,weblink
  1. a sentence is made up of a noun-phrase followed by a verb-phrase;
  2. a noun-phrase is made up of an article followed by an adjective followed by a noun;
  3. a verb-phrase is made up of a verb followed by a noun-phrase;
  4. an article is 'the';
  5. an adjective is 'big' or
  6. an adjective is 'small';
  7. a noun is 'cat' or
  8. a noun is 'mouse';
  9. a verb is 'eats';
The words in bold-face are known as "non-terminals". The words in 'single quotes' are known as "terminals".BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 291
, 0-201-71012-9
, From this production rule listing, complete sentences may be formed using a series of replacements.BOOK
, Rosen
, Kenneth H.
, Discrete Mathematics and Its Applications
, McGraw-Hill, Inc.
, 1991
, 616
, 978-0-07-053744-6
,weblink The process is to replace non-terminals with either a valid non-terminal or a valid terminal. The replacement process repeats until only terminals remain. One valid sentence is:
  • sentence
  • noun-phrase verb-phrase
  • article adjective noun verb-phrase
  • the adjective noun verb-phrase
  • the big noun verb-phrase
  • the big cat verb-phrase
  • the big cat verb noun-phrase
  • the big cat eats noun-phrase
  • the big cat eats article adjective noun
  • the big cat eats the adjective noun
  • the big cat eats the small noun
  • the big cat eats the small mouse
However, another combination results in an invalid sentence:
  • the small mouse eats the big cat
Therefore, a semantic is necessary to correctly describe the meaning of an eat activity.One production rule listing method is called the Backus–Naur form (BNF).BOOK
, Rosen
, Kenneth H.
, Discrete Mathematics and Its Applications
, McGraw-Hill, Inc.
, 1991
, 623
, 978-0-07-053744-6
,weblink BNF describes the syntax of a language and itself has a syntax. This recursive definition is an example of a meta-language. The syntax of BNF includes:
  • ::= which translates to is made up of a[n] when a non-terminal is to its right. It translates to is when a terminal is to its right.
  • | which translates to or.
  • which surround non-terminals.
Using BNF, a subset of the English language can have this production rule listing:
::=
::=
::=
::= the
::= big | small
::= cat | mouse
::= eats
Using BNF, a signed-integer has the production rule listing:BOOK
, Rosen
, Kenneth H.
, Discrete Mathematics and Its Applications
, McGraw-Hill, Inc.
, 1991
, 624
, 978-0-07-053744-6
,weblink


::=
::= + | -
::= |
::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Notice the recursive production rule:
::= |
This allows for an infinite number of possibilities. Therefore, a semantic is necessary to describe a limitation of the number of digits.Notice the leading zero possibility in the production rules:
::= |
::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Therefore, a semantic is necessary to describe that leading zeros need to be ignored.Two formal methods are available to describe semantics. They are denotational semantics and axiomatic semantics.BOOK
, Wilson
, Leslie B.
, Comparative Programming Languages, Third Edition
, Addison-Wesley
, 2001
, 297
, 0-201-71012-9
,

Software engineering and computer programming

File:Two women operating ENIAC (full resolution).jpg|thumb|right|Prior to programming languages, Betty Jennings and Fran Bilas programmed the ENIACENIACSoftware engineering is a variety of techniques to produce quality computer programs.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, Preface
, 0-256-08515-3
, Computer programming is the process of writing or editing source code. In a formal environment, a systems analyst will gather information from managers about all the organization's processes to automate. This professional then prepares a detailed plan for the new or modified system.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 507
, 0-619-06489-7
, The plan is analogous to an architect's blueprint.

Performance objectives

The systems analyst has the objective to deliver the right information to the right person at the right time.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 513
, 0-619-06489-7
, The critical factors to achieve this objective are:
  1. The quality of the output. Is the output useful for decision-making?
  2. The accuracy of the output. Does it reflect the true situation?
  3. The format of the output. Is the output easily understood?
  4. The speed of the output. Time-sensitive information is important when communicating with the customer in real time.

Cost objectives

Achieving performance objectives should be balanced with all of the costs, including:BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 514
, 0-619-06489-7
,
  1. Development costs.
  2. Uniqueness costs. A reusable system may be expensive. However, it might be preferred over a limited-use system.
  3. Hardware costs.
  4. Operating costs.
Applying a systems development process will mitigate the axiom: the later in the process an error is detected, the more expensive it is to correct.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 516
, 0-619-06489-7
,

Waterfall model

The waterfall model is an implementation of a systems development process.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 8
, 0-256-08515-3
, As the waterfall label implies, the basic phases overlap each other:BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 517
, 0-619-06489-7
,
  1. The investigation phase is to understand the underlying problem.
  2. The analysis phase is to understand the possible solutions.
  3. The design phase is to plan the best solution.
  4. The implementation phase is to program the best solution.
  5. The maintenance phase lasts throughout the life of the system. Changes to the system after it is deployed may be necessary.BOOK


, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 345
, 0-256-08515-3
, Faults may exist, including specification faults, design faults, or coding faults. Improvements may be necessary. Adaption may be necessary to react to a changing environment.

Computer programmer

A computer programmer is a specialist responsible for writing or modifying the source code to implement the detailed plan. A programming team is likely to be needed because most systems are too large to be completed by a single programmer.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 319
, 0-256-08515-3
, However, adding programmers to a project may not shorten the completion time. Instead, it may lower the quality of the system. 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.Computer programmers may be programming in the small: programming within a single module.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 331
, 0-256-08515-3
, Chances are a module will execute modules located in other source code files. Therefore, computer programmers may be programming in the large: programming modules so they will effectively couple with each other. Programming-in-the-large includes contributing to the application programming interface (API).

Program modules

Modular programming is a technique to refine imperative language programs. Refined programs may reduce the software size, separate responsibilities, and thereby mitigate software aging. A program module is a sequence of statements that are bounded within a block and together identified by a name.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 216
, 0-256-08515-3
, Modules have a function, context, and logic:BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 219
, 0-256-08515-3
,
  • The function of a module is what it does.
  • The context of a module are the elements being performed upon.
  • The logic of a module is how it performs the function.
The module's name should be derived first by its function, then by its context. Its logic should not be part of the name. For example, function compute_square_root( x ) or function compute_square_root_integer( i : integer ) are appropriate module names. However, function compute_square_root_by_division( x ) is not.The degree of interaction within a module is its level of cohesion. Cohesion is a judgment of the relationship between a module's name and its function. The degree of interaction between modules is the level of coupling.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 226
, 0-256-08515-3
, Coupling is a judgement of the relationship between a module's context and the elements being performed upon.

Cohesion

The levels of cohesion from worst to best are:BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 220
, 0-256-08515-3
,
  • Coincidental Cohesion: A module has coincidental cohesion if it performs multiple functions, and the functions are completely unrelated. For example, function read_sales_record_print_next_line_convert_to_float(). Coincidental cohesion occurs in practice if management enforces silly rules. For example, "Every module will have between 35 and 50 executable statements."
  • Logical Cohesion: A module has logical cohesion if it has available a series of functions, but only one of them is executed. For example, function perform_arithmetic( perform_addition, a, b ).
  • Temporal Cohesion: A module has temporal cohesion if it performs functions related to time. One example, function initialize_variables_and_open_files(). Another example, stage_one(), stage_two(), ...
  • Procedural Cohesion: A module has procedural cohesion if it performs multiple loosely related functions. For example, function read_part_number_update_employee_record().
  • Communicational Cohesion: A module has communicational cohesion if it performs multiple closely related functions. For example, function read_part_number_update_sales_record().
  • Informational Cohesion: A module has informational cohesion if it performs multiple functions, but each function has its own entry and exit points. Moreover, the functions share the same data structure. Object-oriented classes work at this level.
  • Functional Cohesion: a module has functional cohesion if it achieves a single goal working only on local variables. Moreover, it may be reusable in other contexts.

Coupling

The levels of coupling from worst to best are:
  • Content Coupling: A module has content coupling if it modifies a local variable of another function. COBOL used to do this with the alter verb.
  • Common Coupling: A module has common coupling if it modifies a global variable.
  • Control Coupling: A module has control coupling if another module can modify its control flow. For example, perform_arithmetic( perform_addition, a, b ). Instead, control should be on the makeup of the returned object.
  • Stamp Coupling: A module has stamp coupling if an element of a data structure passed as a parameter is modified. Object-oriented classes work at this level.
  • Data Coupling: A module has data coupling if all of its input parameters are needed and none of them are modified. Moreover, the result of the function is returned as a single object.

Data flow analysis

(File:Sandwich data flow diagram.pdf|thumb|A sample function-level data-flow diagram)Data flow analysis is a design method used to achieve modules of functional cohesion and data coupling.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 258
, 0-256-08515-3
, The input to the method is a data-flow diagram. A data-flow diagram is a set of ovals representing modules. Each module's name is displayed inside its oval. Modules may be at the executable level or the function level.The diagram also has arrows connecting modules to each other. Arrows pointing into modules represent a set of inputs. Each module should have only one arrow pointing out from it to represent its single output object. (Optionally, an additional exception arrow points out.) A daisy chain of ovals will convey an entire algorithm. The input modules should start the diagram. The input modules should connect to the transform modules. The transform modules should connect to the output modules.BOOK
, Schach
, Stephen R.
, Software Engineering
, Aksen Associates Incorporated Publishers
, 1990
, 259
, 0-256-08515-3
,

Functional categories

File:Operating system placement (software).svg|thumb|upright|A diagram showing that the user interacts with the application software. The application software interacts with the operating system, which interacts with the hardware.]]Computer programs may be categorized along functional lines. The main functional categories are application software and system software. System software includes the operating system, which couples computer hardware with application software. The purpose of the operating system is to provide an environment where application software executes in a convenient and efficient manner.BOOK
, Silberschatz
, Abraham
, Operating System Concepts, Fourth Edition
, Addison-Wesley
, 1994
, 1
, 978-0-201-50480-4
, Both application software and system software execute utility programs. At the hardware level, a microcode program controls the circuits throughout the central processing unit.

Application software

Application software is the key to unlocking the potential of the computer system.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 147
, 0-619-06489-7
, The key to unlocking the potential of any computer system is application software.
, Enterprise application software bundles accounting, personnel, customer, and vendor applications. Examples include enterprise resource planning, customer relationship management, and supply chain management software.Enterprise applications may be developed in-house as a one-of-a-kind proprietary software.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 147
, 0-619-06489-7
, Alternatively, they may be purchased as off-the-shelf software. Purchased software may be modified to provide custom software. If the application is customized, then either the company's resources are used or the resources are outsourced. Outsourced software development may be from the original software vendor or a third-party developer.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 147
, 0-619-06489-7
, [A] third-party software firm, often called a value-added software vendor, may develop or modify a software program to meet the needs of a particular industry or company.
, The potential advantages of in-house software are features and reports may be developed exactly to specification.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 148
, 0-619-06489-7
, Heading: Proprietary Software; Subheading: Advantages; Quote: You can get exactly what you need in terms of features, reports, and so on.
, Management may also be involved in the development process and offer a level of control.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 148
, 0-619-06489-7
, Heading: Proprietary Software; Subheading: Advantages; Quote: Being involved in the development offers a further level of control over the results.
, Management may decide to counteract a competitor's new initiative or implement a customer or vendor requirement.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 147
, 0-619-06489-7
, Heading: Proprietary Software; Subheading: Advantages; Quote: There is more flexibility in making modifications that may be required to counteract a new initiative by one of your competitors or to meet new supplier and/or customer requirements.
, A merger or acquisition may necessitate enterprise software changes. The potential disadvantages of in-house software are time and resource costs may be extensive. Furthermore, risks concerning features and performance may be looming.The potential advantages of off-the-shelf software are upfront costs are identifiable, the basic needs should be fulfilled, and its performance and reliability have a track record. The potential disadvantages of off-the-shelf software are it may have unnecessary features that confuse end users, it may lack features the enterprise needs, and the data flow may not match the enterprise's work processes.One approach to economically obtaining a customized enterprise application is through an application service provider.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 149
, 0-619-06489-7
, Specialty companies provide hardware, custom software, and end-user support. They may speed the development of new applications because they possess skilled information system staff. The biggest advantage is it frees in-house resources from staffing and managing complex computer projects. Many application service providers target small, fast-growing companies with limited information system resources. On the other hand, larger companies with major systems will likely have their technical infrastructure in place. One risk is having to trust an external organization with sensitive information. Another risk is having to trust the provider's infrastructure reliability.

Operating system

{{See also|Operating system}}File:Concepts- Program vs. Process vs. Thread.jpg|thumb|Program vs. Process vs. Thread Scheduling, Preemption, Context SwitchingContext SwitchingAn operating system is the low-level software that supports a computer's basic functions, such as scheduling processes and controlling peripherals.In the 1950s, the programmer, who was also the operator, would write a program and run it. After the program finished executing, the output may have been printed, or it may have been punched onto paper tape or cards for later processing. More often than not the program did not work. The programmer then looked at the console lights and fiddled with the console switches. If less fortunate, a memory printout was made for further study. In the 1960s, programmers reduced the amount of wasted time by automating the operator's job. A program called an operating system was kept in the computer at all times.BOOK
,weblink
, Structured Computer Organization, Third Edition
, Tanenbaum
, Andrew S.
, Prentice Hall
, 1990
, 978-0-13-854662-5
, 11,
The term operating system may refer to two levels of software.BOOK
, The Linux Programming Interface
, Kerrisk
, Michael
, No Starch Press
, 2010
, 978-1-59327-220-3
, 21, The operating system may refer to the kernel program that manages the processes, memory, and devices. More broadly, the operating system may refer to the entire package of the central software. The package includes a kernel program, command-line interpreter, graphical user interface, utility programs, and editor.

Kernel Program

(File:Kernel Layout.svg|thumb|A kernel connects the application software to the hardware of a computer.)The kernel's main purpose is to manage the limited resources of a computer:

, The Linux Programming Interface
, Kerrisk
, Michael
, No Starch Press
, 2010
, 978-1-59327-220-3
, 22, which is also known as a context switch. The kernel creates a process control block when a program is selected for execution. However, an executing program gets exclusive access to the central processing unit only for a time slice. To provide each user with the appearance of continuous access, the kernel quickly preempts each process control block to execute another one. The goal for system developers is to minimize dispatch latency.
(File:Virtual memory.svg|thumb|250px|Physical memory is scattered around RAM and the hard disk. Virtual memory is one continuous block.)

* When the kernel initially loads an executable into memory, it divides the address space logically into regions.BOOK
, Bach
, Maurice J.
, The Design of the UNIX Operating System
, Prentice-Hall, Inc.
, 1986
, 152
, 0-13-201799-7
, The kernel maintains a master-region table and many per-process-region (pregion) tables—one for each running process. These tables constitute the virtual address space. The master-region table is used to determine where its contents are located in physical memory. The pregion tables allow each process to have its own program (text) pregion, data pregion, and stack pregion.


*The program pregion stores machine instructions. Since machine instructions do not change, the program pregion may be shared by many processes of the same executable. * To save time and memory, the kernel may load only blocks of execution instructions from the disk drive, not the entire execution file completely. *The kernel is responsible for translating virtual addresses into physical addresses. The kernel may request data from the memory controller and, instead, receive a page fault.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 443
, 978-0-13-291652-3
, If so, the kernel accesses the memory management unit to populate the physical data region and translate the address.BOOK
, Lacamera
, Daniele
, Embedded Systems Architecture
, Packt
, 2018
, 8
, 978-1-78883-250-2
,


* The kernel allocates memory from the heap upon request by a process. When the process is finished with the memory, the process may request for it to be freed. If the process exits without requesting all allocated memory to be freed, then the kernel performs garbage collection to free the memory. * The kernel also ensures that a process only accesses its own memory, and not that of the kernel or other processes.
  • The kernel program should perform file system management. The kernel has instructions to create, retrieve, update, and delete files.
  • The kernel program should perform device management. The kernel provides programs to standardize and simplify the interface to the mouse, keyboard, disk drives, printers, and other devices. Moreover, the kernel should arbitrate access to a device if two processes request it at the same time.
  • The kernel program should perform network management.BOOK


, The Linux Programming Interface
, Kerrisk
, Michael
, No Starch Press
, 2010
, 978-1-59327-220-3
, 23, The kernel transmits and receives packets on behalf of processes. One key service is to find an efficient route to the target system.


, The Unix Programming Environment
, Kernighan
, Brian W.
, Prentice Hall
, 1984
, 0-13-937699-2
, 201,
    • Programmers access files through a relatively simple interface that in turn executes a relatively complicated low-level I/O interface. The low-level interface includes file creation, file descriptors, file seeking, physical reading, and physical writing.
    • Programmers create processes through a relatively simple interface that in turn executes a relatively complicated low-level interface.
    • Programmers perform date/time arithmetic through a relatively simple interface that in turn executes a relatively complicated low-level time interface.BOOK


, The Linux Programming Interface
, Kerrisk
, Michael
, No Starch Press
, 2010
, 978-1-59327-220-3
, 187,


, Unix System Programming
, Haviland
, Keith
, Addison-Wesley Publishing Company
, 1987
, 0-201-12919-1
, 121, For a large software system, it may be desirable to engineer the system into smaller processes. Processes may communicate with one another by sending and receiving signals.
Originally, operating systems were programmed in assembly; however, modern operating systems are typically written in higher-level languages like C, Objective-C, and Swift.{{efn|The UNIX operating system was written in C, macOS was written in Objective-C, and Swift replaced Objective-C.}}

Utility program

A utility program is designed to aid system administration and software execution. Operating systems execute hardware utility programs to check the status of disk drives, memory, speakers, and printers.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 145
, 0-619-06489-7
, A utility program may optimize the placement of a file on a crowded disk. System utility programs monitor hardware and network performance. When a metric is outside an acceptable range, a trigger alert is generated.BOOK
, Stair
, Ralph M.
, Principles of Information Systems, Sixth Edition
, Thomson
, 2003
, 146
, 0-619-06489-7
, Utility programs include compression programs so data files are stored on less disk space. Compressed programs also save time when data files are transmitted over the network. Utility programs can sort and merge data sets. Utility programs detect computer viruses.

Microcode program

(File:Not-gate-en.svg|thumb|96px|right|NOT gate)(File:NAND_ANSI_Labelled.svg|thumb|96px|right|NAND gate)(File:NOR_ANSI_Labelled.svg|thumb|96px|right|NOR gate)(File:AND_ANSI_Labelled.svg|thumb|96px|right|AND gate)(File:OR_ANSI_Labelled.svg|thumb|96px|right|OR gate)A microcode program is the bottom-level interpreter that controls the data path of software-driven computers.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 6
, 978-0-13-291652-3
,
(Advances in hardware have migrated these operations to hardware execution circuits.) Microcode instructions allow the programmer to more easily implement the digital logic levelBOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 243
, 978-0-13-291652-3
, —the computer's real hardware. The digital logic level is the boundary between computer science and computer engineering.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 147
, 978-0-13-291652-3
,
A logic gate is a tiny transistor that can return one of two signals: on or off.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 148
, 978-0-13-291652-3
,
  • Having one transistor forms the NOT gate.
  • Connecting two transistors in series forms the NAND gate.
  • Connecting two transistors in parallel forms the NOR gate.
  • Connecting a NOT gate to a NAND gate forms the AND gate.
  • Connecting a NOT gate to a NOR gate forms the OR gate.
These five gates form the building blocks of binary algebra—the digital logic functions of the computer.Microcode instructions are mnemonics programmers may use to execute digital logic functions instead of forming them in binary algebra. They are stored in a central processing unit's (CPU) control store.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 253
, 978-0-13-291652-3
,
These hardware-level instructions move data throughout the data path.The micro-instruction cycle begins when the microsequencer uses its microprogram counter to fetch the next machine instruction from random-access memory.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 255
, 978-0-13-291652-3
, The next step is to decode the machine instruction by selecting the proper output line to the hardware module.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 161
, 978-0-13-291652-3
,
The final step is to execute the instruction using the hardware module's set of gates.(File:ALU block.gif|thumb|right|A symbolic representation of an ALU)Instructions to perform arithmetic are passed through an arithmetic logic unit (ALU).BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 166
, 978-0-13-291652-3
, The ALU has circuits to perform elementary operations to add, shift, and compare integers. By combining and looping the elementary operations through the ALU, the CPU performs its complex arithmetic.
Microcode instructions move data between the CPU and the memory controller. Memory controller microcode instructions manipulate two registers. The memory address register is used to access each memory cell's address. The memory data register is used to set and read each cell's contents.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 249
, 978-0-13-291652-3
,
Microcode instructions move data between the CPU and the many computer buses. The disk controller bus writes to and reads from hard disk drives. Data is also moved between the CPU and other functional units via the peripheral component interconnect express bus.BOOK
, Tanenbaum
, Andrew S.
, Structured Computer Organization, Sixth Edition
, Pearson
, 2013
, 111
, 978-0-13-291652-3
,

Notes

{{Notelist}}

References

{{reflist|30em}}

- content above as imported from Wikipedia
- "Computer program" does not exist on GetWiki (yet)
- time: 6:11pm EDT - Wed, May 01 2024
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 23 MAY 2022
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
CONNECT