1 / 17

Programming Languages: Exploring the Tower of Babel

Understand why there are so many programming languages, their differences, and how each one meets specific needs. Explore procedural languages like Fortran and COBOL, as well as object-oriented programming and special-purpose languages.

fleroy
Download Presentation

Programming Languages: Exploring the Tower of Babel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 8 The Tower of Babel

  2. Chapter Outline • Procedural languages • Fortran, COBOL, PASCAL, C, Ada • Object-oriented programming • Special-purpose languages • SEL, Perl, HTML, XML • Alternative programming paradigms • Functional programming

  3. Why Babel? • Why are there so many different programming languages? • Each programming language was designed to meet specific needs. • One program may be better suited than others for writing certain kinds of programs. • Similar to automobile market

  4. Example • C++ was not designed with engineering applications in mind • For example, there is no operator for exponentiation (exp, power are all defined in math.h> • Report writing with columns of figures and blocks of information is better handled by COBOL. • Database query, Web page construction…

  5. Procedural Languages • Also known as imperative languages • A program written in a procedural language consists of sequences of statements that manipulate data items. • Programmers devise the appropriate step-by-step sequence of “imperative commands”– instructions in the programming language– that will accomplish the desired task. • Follow directly from the Von Neumann architecture described in Chapter 5.

  6. Examples • FORTRAN, COBOL, Pascal, C, Ada. • Differ in: • how the statements must be arranged on a line • how variables can be named • how a new value is assigned to a variable • how the flow control is handled • I/O statements • how to break programs into modules and how modules share information • We will NOT study the syntactical differences among these languages. • Will focus on the history and “intent” of each one.

  7. FORTRAN • FORmula TRANslation • Affiliation with formulas or engineering-type applications • Developed in the mid-1950s by IBM. First released in 1957. • The first high-level programming language • Exponentiation, extend-precision arithmetic, complex number system • FORTRAN II, FORTRAN IV, FORTRAN 77, FORTRAN 90, High performance FORTRAN

  8. Example 10 IF (NUMBER .LT. 0) GO TO 20 . . READ (*,*) NUMBER GO TO 10 20 …

  9. Flow Control with GO TO • There is no while statement in FORTRAN. Use GO TO to implement looping. • Excessive and careless use of GO TOs can make a program very difficult to read. • Spaghetti code

  10. Features • Designed to support numerical computations • Optimize the resulting object code • A large and well-tested FORTRAN library exists. • Old dog, new tricks

  11. COBOL • COmmon Business-Oriented Language • Developed in 1959-1960 by Grace Hopper of U.S. Navy. • Designed to serve business needs such as managing inventories and payrolls. • Processing in the business world concerns updating “master files” with changes from “transaction files”. • Summary reports are most important output products.

  12. Features of COBOL • More adept in handling file input than keyboard input. • Attention was paid to input/output formatting • English-like statements • Sum = a+ b ; (C++) • ADD A TO B GIVING SUM. (COBOL) • Y2K problem • http://www.cobol.org

  13. Pascal • Named after Blaise Pascal • Developed by Niklaus Wirth in 1970s. • Easy to learn and help enforce good programming techniques. • Designed for teaching programming • Similar to pseudo-code. • Delphi uses Pascal as its language core.

  14. C • Developed in the 1970s by Dennis Ritchie at AT&T Bell lab. • Originally designed for systems programming – UNIX OS. • C has become a popular general-purpose language for two main reasons: • Relationship between C and UNIX • Efficiency • Low-level memory manipulation by pointer • Device-driver

  15. Ada • Common high-level language for use by defense contractors. • Started in mid 1970s. • Requirements on efficiency, reliability, readability and maintainability. • Ada, Ada 9X, Ada 95. • Multi-processing capability, OO • http://www.adahome.com

  16. Ada Example with Text_IO; use Text_IO; procedure Forever is begin loop Put_Line("Hello again!"); end loop; end Forever;

  17. The PIE of OOP Inheritance Polymorphism Encapsulation

More Related