Fundamental Programming - Lecture 2 - Language Evolution
Fundamental Programming - Lecture 2 - Language Evolution
Language Evolution
OBJECTIVES
After reading this chapter, the reader should be able to:
• Have a vision of computer language evolution.
• Distinguish between machine, assembly, and high-level languages.
• Understand the process of creating and running a program.
• Distinguish between the different categories of languages: procedural,
object-oriented, functional, declarative, and special.
Evolution of computer languages
Program in machine language
1 00000000 00000100 0000000000000000
2 01011110 00001100110000100000000000000010
3 11101111 000101100000000000000101
4 11101111 10011110 0000000000001011
5 11111000 10101101 11011111 0000000000010010
6 0110001011011111 0000000000010101
7 11101111 00000010 11111011 0000000000010111
8 11110100 1010110111011111 0000000000011110
9 0000001110100010 11011111 0000000000100001
10 11101111 00000010 11111011 0000000000100100
11 01111110 11110100 10101101
12 11111000 10101110 110001010000000000101011
13 0000011010100010 11111011 0000000000110001
14 11101111 00000010 11111011 0000000000110100
15 00000100 0000000000111101
16 00000100 0000000000111101
Note:
disk
monitor
computer
CATEGORIES OF LANGUAGES
Categories of languages
Procedural language
• A procedural (imperative 命令) language is a set of instructions that
are executed one by one from beginning to end unless an instruction
forces the control elsewhere.
• FORTRAN
• COBOL
• Pascal
• C
• Ada
Object-Oriented languages
• In object-oriented programming, the objects and the operations to be
applied to them are tied together.
• The objects in object-oriented programming are active.
• C++
• Java
C++
• C++: developed by Bjarne Stroustrup at Bell Lab
• Three principles:
• Encapsulation (封裝)
• The user knows what to do with the data without knowing how it is
done.
• Inheritance (繼承)
• When a general class is defined, you can define a more specific class
that inherits some of the characteristics of the general class but also
has some new characteristics.
• Polymorphism (多型)
• You can define several operations with the same name that can do
different things in related classes.
Java
• Java:
• Developed at Sun Microsystems,, Inc.
• The language is totally class oriented.
• Every data item belongs to a class.
• The browser can download the applet (小小的應用程式) and run it locally.
• Features:
• Class library
• Multithreading
Functional languages
• A functional language:
• Predefines a set of primitive functions
• Allow the programmer to combine primitive functions to create new function