Вы находитесь на странице: 1из 30

Information Technology INT1001

Lecture 9 Programming Languages


1

Computers Are Your Future


Tenth Edition

Chapter 11: Programming Languages & Program Development

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Programming Language & Program Development

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Development of Program Languages

Programming is the creation of software applications. Programmers are the people who create the software applications. A programming language is a language used by programmers to create programs or software that the computer understands.
Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall 4

Development of Program Languages

Syntax is the vocabulary and grammar of a programming language. Code is the programming instructions created by the programmers. Source code, the only form of code that humans can read, is program code in its original form.

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Development of Program Languages

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Development of Program Languages

There are five distinct programming language generations, or levels:

Machine language Assembly language Procedural languages Nonprocedural languages Natural languages

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Development of Program Languages

Machine language

First-generation language Based on binary numbers The only programming language a computer understands directly

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Development of Program Languages

Assembly language

A low-level, second-generation language Requires programming individual instructions for each task to be performed by the microprocessor Mnemonics

Uses brief abbreviations for program instructions Makes language easier to use than machine language
9

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

Development of Program Languages

Procedural languages

Third-generation languages Considered high-level languages Do not require programmers to know details relating to the processing of data Easier to read, write, and maintain

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

10

Development of Program Languages

Two utility programs that translate code so that the computer can interpret and run programs are:

Compilers

Translate source code into object code Translate source code and execute instructions

Interpreters

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

11

Development of Program Languages

Categories of Procedural Language

Structured programming languages

A solution to spaghetti code


Lots of GOTO statements Difficult to follow and prone to errors

A set of standards to make programs more readable, reliable, and maintainable

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

12

Development of Program Languages

Categories of Procedural Language (continued)

Modular programming languages

Divide programs into self-contained modules Use information hiding: keeping information about one module secret from authors of other modules

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

13

Development of Program Languages

Nonprocedural languages

Fourth-generation languages

Report generators (database reports) Query languages Doesnt require programmers to deal with stepby-step procedures to achieve the appropriate programming outcome

SQL (structured query language)

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

14

Development of Program Languages

Natural language

Fifth-generation languages Still being perfected Nonprocedural Use everyday language to program

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

15

A Guide to Programming Languages: One Size Doesnt Fit All

Programmers must select the programming language that can best meets the users needs. Two programming languages that have been used since the 1950s are:

COBOL (Common Business-Oriented Language) for business applications Fortran (formula translator) for scientific/math/engineering applications

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

16

A Guide to Programming Languages: One Size Doesnt Fit All

Structured and modular languages

Required for large-scale program development Examples


Ada BASIC Visual Basic Pascal C


17

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

A Guide to Programming Languages: One Size Doesnt Fit All

Object-oriented languages

Provide easier programming techniques Examples

Smalltalk C++ Java Visual Basic.NET

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

18

A Guide to Programming Languages: One Size Doesnt Fit All

Web-based languages

Not considered programming languages Enable the interpretation of both text and objects by browsers Two types:

Markup languages Scripting languages

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

19

A Guide to Programming Languages: One Size Doesnt Fit All

Markup languages

Define text structure through a set of instructions that are identified with tags. Content lies between tags.

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

20

A Guide to Programming Languages: One Size Doesnt Fit All

Types of markup languages include:


HTML (Hypertext Markup Language) XML (Extensible Markup Language) XHTML (eXtensible Hypertext Markup Language

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

21

A Guide to Programming Languages: One Size Doesnt Fit All

Scripting languages

Use basic programs called scripts to control Web page actions or responses VBScript JavaScript Visual Studio.NET

Types of scripting languages include:


Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

22

The Program Development Life Cycle

Program development life cycle (PDLC)

Used to overcome debugging and maintenance problems Made up of six phases, from problem definition through program implementation and maintenance

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

23

The Program Development Life Cycle

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

24

What Youve Learned

A programming language, which is made up of its own vocabulary and syntax, creates instructions that a computer understands. Machine language is based on binary code. Assembly language is similar but a little easier to understand than machine language. Both are difficult and demanding compared to later languages.
Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall 25

What Youve Learned

Unlike machine and assembly languages, third-generation (high-level) programming languages do not require programmers to have a thorough understanding of processor details. Fourth-generation languages, although even easier for programmers to use, are mostly restricted to accessing databases.
Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall 26

What Youve Learned

Object-oriented programming languages work with prebuilt objects for fast, even simpler programming when compared to earlier-generation languages. The program development life cycle (PDLC) minimizes errors and maintenance problems.
Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall 27

What Youve Learned

The six phases of the program development life cycle (PDLC) are (1) defining the problem, (2) designing the program, (3) coding the program, (4) testing and debugging the program, (5) documenting the program, and (6) implementing and maintaining the program.
Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall 28

What Youve Learned

Debugging and maintaining programs using top-down program design are simpler because program functions are divided into separate modules. Algorithms to perform any processing task can be created by programmers using sequence, selection, and repetition control structures.
Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall 29

What Youve Learned

There are two types of bugs: syntax errors, which are errors caused by faulty command structure, and logic errors, which are errors caused by faulty programming design.

Copyright 2009 Pearson Education, Inc. Publishing as Prentice Hall

30

Вам также может понравиться