3Class and Object Features

A functional program executes a sequence of function calls to create the result of the program, an imperative program executes a sequence of state changes to create the result state of the program. The two points of view can be easily combined, since most programming languages offer both possibilities, facilitated by the use of modular features. Object-oriented programming is sometimes presented as belonging to the concurrent paradigm, which differs significantly from functional and imperative ones. Different entities, often called objects, contribute to the elaboration of the result by exchanging messages in parallel; the reception of a message triggering an action or an evaluation. This view has spread from the arrival of the first object-oriented languages such as Simula, introduced in the 1960s to create simulation programs, Smalltalk, created in the 1970s by Xerox, Eiffel, etc. However, we present object-oriented programming, staying within the framework of functional and imperative programming.

Section 3.1 includes a very classical description of the object features, which also serves to establish our vocabulary. Section 3.2 proposes a model of these features, using the kits studied in Chapter 1. This modeling remains rather informal but provides guidance for reading a reference manual. This section briefly explains why we cannot more formally describe the typing and evaluation of objects and classes.

3.1. Object-oriented features

An object-oriented ...

Get Concepts and Semantics of Programming Languages 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.