Lecture Programming languages (2/e): Chapter 12a - Tucker, Noonan

The imperative programming paradigm is the subject of Chapter 12. This chapter presents the following content: What makes a language imperative? Procedural abstraction, expressions and assignment, library support for data structures. | Programming Languages 2nd edition Tucker and Noonan Chapter 12 Imperative Programming I really hate this darn machine; I wish they would sell it; It won’t do what I want it to, but only what I tell it. Programmer’s lament (anonymous) Contents What Makes a Language Imperative? Procedural Abstraction Expressions and Assignment Library Support for Data Structures C Ada Perl Imperative Programming Oldest and most well-developed paradigm Mirrors computer architecture Languages Fortran, Pascal C, Clite Ada 83 What Makes a Language Imperative? In a von Neumann machine memory holds: Instructions Data Intellectual heart: assignment statement Others: Conditional branching Unconditional branch (goto) Flowchart Procedural Abstraction Procedural abstraction allows the programmer to be concerned mainly with a function interface, ignoring the details of how it is computed. The process of stepwise refinement utilizes procedural abstraction to develop an algorithm starting with a general form and ending with an implementation. Ex: sort(list, len) Expressions and Assignment Assignment statement is fundamental: target = expression Copy semantics: Expression is evaluated to a value, which is copied to the target; used by imperative languages Reference semantics: Expression is evaluated to an object, whose pointer is copied to the target; used by object-oriented languages. There exist vast libraries of functions for most imperative languages. Partially accounts for the longevity of languages like Fortran, Cobol, and C. Turing Complete Integer variables, values, operations Assignment If Goto Re: Structured programming revolution of 1970s replace the goto with while . | Programming Languages 2nd edition Tucker and Noonan Chapter 12 Imperative Programming I really hate this darn machine; I wish they would sell it; It won’t do what I want it to, but only what I tell it. Programmer’s lament (anonymous) Contents What Makes a Language Imperative? Procedural Abstraction Expressions and Assignment Library Support for Data Structures C Ada Perl Imperative Programming Oldest and most well-developed paradigm Mirrors computer architecture Languages Fortran, Pascal C, Clite Ada 83 What Makes a Language Imperative? In a von Neumann machine memory holds: Instructions Data Intellectual heart: assignment statement Others: Conditional branching Unconditional branch (goto) Flowchart Procedural Abstraction Procedural abstraction allows the programmer to be concerned mainly with a function interface, ignoring the details of how it is computed. The process of stepwise refinement utilizes procedural abstraction to develop an .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
2    73    2    01-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.