Title: History of Programming Languages and Programming Language Concepts
1History of Programming Languages and
Programming Language Concepts
2What does a computer program do?
3A computer program is
- a set of instructions that tell a computer how
to perform a particular task.
4A computer program is like
- a recipe
- A recipe is a set of instructions to tell a cook
how to make a particular dish. - It describes the ingredients (the data) and the
sequence of steps (the process) needed to convert
the ingredients into the cake.
5What is programming?
6Programming is
- -- the effort in coming up with a set of
instructions that describe how a problem can be
solved.
7- We always think a program is a computer
language, but actually, programs can be in many
languages and in many forms. Lets
look at an example
8A simple program
- An English language example
- On the back of a shampoo bottle
- Wet Hair
- Lather
- Rinse
- Repeat
9Interpretations Assumptions..
- Notice those 4 instructions (wet hair, lather,
rinse, repeat)makes several assumptions - Lather also implies pouring some shampoo from
the bottle onto either your hand or head - Step 4 really means repeat once
10Major difference between humans computers..
- Humans have judgment free will.
- They will not follow any instruction they
determine not required or nonsensical - Computers will do EXACTLY what is toldwith no
judgment or sanity checks
11!!!
- Give those instructions to your computer and
it will neverget out of the shower!!
12So how does a program tell the computer exactly
what needs to be done?
- Just as you speak to a friend in a language that
he/she understands, you need to 'speak' to the
computer in a given language it understands. - The only language that the computer understands
is called binary or machine language. - Programs interact with the computer using machine
language. - Machine language is just made up of 0s and 1s.
13How much can you communicate using only 0s and
1s?
- More than you think!!!
- but its not easy
- so right from the start, its been desired to
have some type of translation process to get
English translated into binary (and back)
14Think of that translation process as being like
an interpreter
Barack Obama
Chinese President Hu Jintao
- Consider the American and Chinese presidents
talking at a summit meeting - One speaks in English, then an interpreter
repeats what has been said in Chinese - The other replies in Chinese and the interpreter
again repeats the sentence, this time in English.
15So lets look back at how that translation
process evolved over the years
16In the beginning there was no translation process
- Early programmers (early 1950s) actually had to
enter the binary codes themselves, (the 1s and
the 0s!!!) - Instructions were entered through the front
panel switches of the computer system. - Coding in binary is regarded as working in a
- First Generation Programming Language (1GL)
17Initial Translation Efforts..
- Entering the 0s and 1s was very time consuming.
- So, effort was spent creating a language that
would reduce this effort - The assembler language was thus created
- It translates English equivalents (really, a
symbolic representation) to machine language
18Example of Assembler language
- The only thing that this program does is to save
two values in two registers and add the value of
one to the other. - In a high level language such as RealBasic, wed
just do something like result 6 4
19Another Assembler example
- This program displays a character string on the
screen 15 times
20Assembler Languages
- Developed in the mid 1950s
- Considered a low level language because
- It is specific to a particular computer
architecture (will only run on a very specific
computer model) - An example If we were to write an assembler
language program to run in H209 it would NOT
work in H210 because we have iMacs in here and
H210 has Mac Minis! - And because you would have to know very low-level
details about the computer in order to be able to
write a program using Assembler - Assembler language is considered a second
generation programming language (2GL)
21Assembler languages..
- Assembler languages use a translation process
called an assembler to translate assembly
language statements into machine code. - There is a11 mapping from each mnemonic
statement into a machine instruction - (contrast that with high level languages a
single statement results in many machine
instructions)
22Assembler Languages (cont)
- Some use of 2GLs (Assembler Language) still used
today - When direct hardware manipulation is needed or
for critical performance - Example device drivers, real time systems(for
high performance)
23An improvement, but more desired
- So 2GL had its uses but more translation
capabilities were desired - It was desired that programming languages be more
easily understood - It was also desired that the same program could
be run on different types of architectures
243GLs
- First introduced in the late 1950s
- Introduced concept of structured programming (did
not have to directly work with registers could
also use algebraic expressions) - Introduced a level of abstraction away from the
hardware. This made it more user friendly
making it easier to learn use - Used translation processes called compilers and
interpreters - Introduced database management systems
- Early examples
- Fortran (1956) used for science math (lots of
precision) - COBOL (1959) used for business purposes
- Modern examples
- BASIC (1964) used for regular folks to write
easy programs - C, C -- general purpose
- JAVA (1995) -- used as applets on web pages
25BASIC example displays room, patient name,
doctor name
264th generation programming languages (4GL)
- First appeared in the1970s
- Languages designed with a specific purpose in
mind such as the development of commercial
business software.
27Some Different types of 4GLsin the 1970-1990 era
- Report generators PostScript
- Data manipulation analysis MAPPER, PL/SQL,
SAS, - Data Query Languages -- SQL
- Screen painters Oracle
- Web Development ColdFusion, CSS
28Is there a 5GL?
- Theres no agreed upon answer
- Some sources claim that thea 5GL language is
programming that uses a visual or graphical
development interface - Other sources claim thatsystems used in the
field of artificial intelligence, fuzzy logic,
and neural networks are 5GL languages.
29High-Level Language (gt2GL)
Assembly Language (2GL)
Machine Language (1GL)
Hardware
30Quick Recap
- High level (3GL, 4GL)
- closer to human languages and further from
machine languages - Easier to understand, write, and maintain.
- Must be translated into machine language by a
compiler or interpreter - Low-level (2GL)
- very close to machine languages (2GL)
- Dependent on a certain type of hardware
-
31Programming Concepts
32Structured Programming
- A long time ago a man called Edsger Dijkstra came
up with a concept called structured programming
meaning that all programs could be structured in
the following four ways
331Sequences of Instructions
342Branches
353Loops
Repeated Steps
364Modules
Shared Module
37Components that programs need..
- Data to work with..
- Operations (add, subtract, compare)
- Input/Output capability
- The ability to get data in
- The ability to get the results out
38Two perspectives of a program
- The one perceived by the user
- The user has an executable file and knows nothing
about how it works it just does - The user executes the program to perform a task
(eg., a word processor, a video game, an image
editor any software that can be installed
executed)
39Two perspectives of a program
- The one perceived by the programmer
- The programmer has the source file that
contains the instructions for the program. - The instructions are written in some programming
language - At some point, the instructions get translated
to an executable file - The programmer needs to know exactly how it
works..
40Translating High Level Languages to Machine Code
- The programmer generates the source code
- Recall that high level languages use a
translation program to convert to machine code
(also known as binary code or machine code)
41How does the translation process work?
- Source code must first be examined for
grammatical errors. (If errors are found the
translation stops) - It is then translated into object code
42Two general types of translation processes
- an interpreter follows this iterative process for
each line of the program - checks for proper syntax
- translates the high-level instruction into
machine code - executes
- A compiler follows this process
- Checks for proper syntax across the entire
program - Then, translates the high-level instructions into
machine code (across the entire program) and puts
the result into an executable file - (A user can then execute the file whenever
desired) - Fyi RealBasic is a compiled language..
43CLI Interface
- The first personal computers operated using a CLI
(command line interface). - Users would type commands directly into the
computer to input or request output.
44GUI Interface
- A Graphical User Interface (GUI) is a user
interface based on graphics (icons, pictures,
menus). Users interact with the interface by
directly manipulating the graphical elements
(e.g., using a keyboard, mouse, joystick, touch
screen, etc) - The GUI is common to all modern applications
written for the Unix/Linux/Apple and Windows
environments.
45Programming in the GUI Environment
- When the GUI environment was in its early days,
programmers found themselves spending countless
hours writing instructions for typical GUI
events - To react to buttons being pressed, to work scroll
bars, to communicate with dialog boxes, and to
interact with menus - This detracted from what programmers were really
trying to achieve in their programs - Tasks that used to take a few lines of program
code now needed pages to comply with GUI
Standards
46This led to object oriented environments
- In object-oriented/event-driven languages, the
emphasis of a program was able to shift to the
objects included in the user interface. - All the handling needed behind the event, called
the event handler, is already taken care of.. - e.g., Detection of events such as mouse rollover,
mouse click, key press, text field change were
already handled and didnt need to be coded by
the programmer
47Where we are..
- C, C, Java, REALbasic, and Visual Basic are
object-oriented/event-driven programming
languages that are easy enough for a
nonprogrammer to use, yet sophisticated enough to
be used by professional programmers
48Next Steps
- Number system conversion
- well be investigating how to convert between the
number system we use the number system
computers use
49.. And after that
- Then with all of this great knowledge under our
belts, well jump into RealBasic and start some
programming!!!