Fundamental programming concepts
Is a programming language really a "language"?
Historical characteristics
A language may be descended from other languages
A language may evolve over time
A language may be specific to a given culture
Languages may cross-pollinate
History of the C language
1963 — CPL (Combined Programming Language)
1967 — BCPL (Basic Combined Programming Language)
1970 — B (during initial Unix development)
1971 — "New B"
1973 — C
1985 — C++ (first commercial release)
1991 — Java
Is a programming language really a "language"?
Linguistic properties
Parts of speech
Noun — thing
Verb — action
Adjective, adverb — modification
Conjunction — grouping
Grammar
Syntax — how the words are combined
Semantics — what the words mean
Is a programming language really a "language"?
Higher-level structures
Idioms
Conventions and ways of using the language not part of its formal definition
A "literature"
"Libraries" of resusable software
"Criticism" of theory and practice
If a program consists of language, what does the program describe?
It describes a process.
It specifies the individual phases of a process.
It IS a process.
A program is a process.
A request
Please get my textbook. Here are the
keys to my car in the far parking lot;
it's the fourth car on the left. If it's
not in the backseat, it's in a box in the
trunk. You'll have to look down through
the stack of books in the box to find
it. I'll be here till you get back.
A more formal request
Please get my text book.
Here are the keys.
Go to the far parking lot.
Count seven cars down on the left.
If it's in the backseat,
get it;
else
open the trunk and
look through the box until you find it.
Bring it to me.
An abstract request made concrete
Please get SOMETHING.
(SOMETHING is "my textbook")
Do ACTION.
(ACTION is "take my keys")
Go to AREA.
(AREA is "far parking lot, down seven")
Look in LOCATION-1.
(LOCATION-1 is "back seat")
If not there, look in LOCATION-2.
(LOCATION-2 is "box in trunk")
Bring it to ME.
(ME is "Andy")
An abstract request made concrete #2
Please get SOMETHING.
(SOMETHING is "my wallet")
Do ACTION.
(ACTION is "quit reading your e-mail")
Go to AREA.
(AREA is "the cafeteria")
Look in LOCATION-1.
(LOCATION-1 is "by the cashier")
If not there, look in LOCATION-2.
(LOCATION-2 is "all the tables")
Bring it to ME.
(ME is "Andy")
What do we need to describe a process?
Naming
"my textbook"
Choosing
"if it's in the backseat..."
Repeating
"seven cars down on the left"
"look through the box until you find it"
Grouping
The instructions of "Please get..."
Basic programming language constructs
Naming
Choosing
Repeating
Grouping
What are some of the programming terms for these ideas?
Naming
"variables"
Choosing
"conditionals"
Repeating
"loops"
Grouping
"functions"