My overall impression is that this book was very boring. It's an okay overview of object-oriented features I supposed but the presentation annoyed meMy overall impression is that this book was very boring. It's an okay overview of object-oriented features I supposed but the presentation annoyed me throughout the book. The way object-orientation was presented reminded me too much of the way I always saw it presented before learning about alternative computational models: as the modern model, contrasted almost exclusively with so called "traditional" programming languages (meaning procedural programming). Other alternative models such as the functional one are briefly mentioned in a few places, but never in a way that suggests that they offer alternative, at least equally flexible models to the object-oriented one. Object-orientation is again and again presented as the way to offer dynamic behavior. Keep in mind that this critique comes from someone who actually likes object-orientation very much, but hates to see it presented in such a simplistic fashion. Not only does the forced connection between dynamic, flexible programming styles and object-orientation diminish the alternative models, it also obstructs a proper description of what is unique to the object-oriented model: that precise way in which object-orientation enables dynamic behavior.
In any case, the mechanisms involved are described to some extent here, but always in a fashion that is a bit too shallow for my tastes. Maybe this is mainly the natural opinion of someone who has read a fair amount of more theoretically oriented literature on the subject of programming language theory and type systems recently and so, frowns upon the almost completely non-technical descriptions found in this book. Maybe the book is an okay introduction to object-oriented concepts for an audience that already has some familiarity with one or more object-oriented languages (or at the very least, one or more programming languages of some sort), but I found it to be boring and uninspiring and to be frank, not that well written. It does deserve three stars anyway I think, since my overall impression of it was something along the lines of: "this is alright I suppose".
This is certainly better than Budd's An Introduction to Object-Oriented Programming as an overview and explication of object-oriented features, but itThis is certainly better than Budd's An Introduction to Object-Oriented Programming as an overview and explication of object-oriented features, but it is still lacking. The presentation is a bit more formal but it falls into the same trap as so much literature on object-orientation: presenting OO as the paradigm for highly flexible programming, contrasting it with "traditional" models (meaning plain procedural programming) and treating polymorphism as something primarily and intrinsically linked to OO. It's not as bad in this respect as some of the worst offenders: other forms of polymorphism are presented and functional programming is treated to some extent, but the presentations of these are okay at best. I personally like OO quite a lot but would like to see more serious presentations, treating it the way it deserves: as one computational model our of many. Other annoyances where the many typos and typographical mishaps sometimes causing some confusion and requiring a closer look with some creative interpretation to understand what was supposed to be written on the page. A good book, but nothing great. I wonder if there are any serious, well-written presentations of object-orientated features at an introductory, non-formal level?
Anyway, I'm off to read Abadi's and Cardelli's A Theory of Objects now, a book I've started but put to the side previously and one which gives a much more formal exposition of object-oriented languages in the form of formal calculi and which also, as I recall, gives a very good, informal overview of the features in its introductory part....more
After spending years on my shelf and having been partially read at least once before, this book was finally finished! (I don't know why I used the pasAfter spending years on my shelf and having been partially read at least once before, this book was finally finished! (I don't know why I used the passive form there, it just felt right for some reason)
I'm glad I did finally read it, even though there were parts that were glanced through without too much attention to detail and even though I skipped the exercises that are probably needed to get a more thorough understanding of the material. I read it mostly as a way to get a good overview of the basics of typed lambda calculi, which the book supplies with a focus on the use of such formalism in the specification and analysis of programming languages. The book is divided into six major parts which all deal with increasing levels of complexity in type systems. The first part introduces untyped formal calculi, first simple arithmetic expressions, then the classic lambda calculus. After this follows a part of simply typed lambda calculi which begins with nothing but function types and later expands this with base types and different structured types such as pairs, tuples, records, lists and other common forms of types. The next major part deals with subtyping and how it interacts with the forms of types presented so far, and after that there's a part of recursive types. While the expansions to the simply typed lambda calculus introduced so far have lots of interesting uses as well as theoretical properties, neither of them introduces something really new in the expressiveness of the language, at least nothing as important as the polymorphism introduced in part five. The reason I value this so much higher is that it enables a completely new form of abstraction. All the systems introduces before this have only the basic function abstraction on the level of terms, but with polymorphism, the ability to abstract over types in terms is introduced (the first step to move away from the first corner of the Barendregt, or lambda, cube which we will talk more about soon). Polymorphism through both universal and existential quantification is presented in different forms and at the end of the part, polymorphism is combined with subtyping in a non-trivial way yielding bounded quantification. Finally, the book is ended with a short part on higher-order systems featuring type operators and kinding (a way to classify the level of types in terms of kinds in the same way that term-level expressions are classified by types) constituting another move in the Barendregt cube where we can now abstract over types in type expressions. The final move possible in the cube, yielding dependent types (abstraction over term-level expressions in types) is also briefly mentioned but not worked out formally as the rest are.
The Barendregt cube is a unifying way to look at the expressiveness possible in the different type systems presented here and elsewhere, and another interesting and unifying theme is that of the Curry-Howard isomorphism, stating that there is a correspondence between programs and proofs on the one hand and types and propositions on the other so that a program having a certain type in a formal calculus corresponds to a proof of a corresponding proposition in a logic. This is discussed at many point throughout the book, giving historical explanations of how the correspondence between specific logics and corresponding type systems have been invented/discovered (depending on your particaular view on philosophy of mathematics and/or logic).
It's a fairly theoretical text, but with many examples, the type systems are not presented as pure formalisms but are motivated through code examples in the calculi presented and at three different points in the book, attempts at formalizing object-oriented concepts in the calculi are presented with increasing sophistication as the new expressive power of the formalisms developed allows it.
As an overview of the formal specifications of programming languages, their syntax and semantics (with a special focus on type systems), along with practical motivations, some points on implementations (almost all the formalisms introduced have actual accompanying implementations to be downloaded from the book's website), proofs of metatheoretic properties and comparisons with some actual programming languages, the book could hardly be better. The only reason that I'm not giving it five stars is that I reserve that for books that are almost perfect, and this does not quite live up to such a high standard. For example, the sometimes very technical proofs are a bit too dense for my taste. Towards the end of the book, there are some attempts at giving a more intuitive sense for some of the formalisations by presenting some of the mechanisms in an anthropomorphic way, by describing a function as saying something along the lines of "give me a value of such and such type, along with a function... and I will apply the function to produce a result..." which I appreciated highly. Had the whole book attempted to present things in such a manner more, had the author stopped now and then to discuss things in a more intuitive way, then I probably would have given it five stars. As it is though, it's an excellent book that I highly recommend for anyone interested in the subject....more