Ceci est une ancienne révision du document !
Object Oriented Programming with ANSI-C par Axel-Tobias Schreiner (Programmation orientée objet en ANSI-C)
There is something about C that many of us can't let go of it. With the advent of programming languages such as Python and Java, many others have started to wonder, is C worth learning? Or, more importantly, is C as powerful as these relatively new languages? When I tried to break down what power actually meant, I stumbled upon things such as a standard template library, portability, etc, but the one that really caught my attention was object orientation. I thought it would to impossible to implement things such as inheritance and class level abstractions in a language like C, but then I came across this book called “OOC”. I have never, ever read a book like this one. What makes it special is that instead of throwing the class-like syntax at you, it dwells deep into the concept of abstraction. For the first time in my life, I was able to feel polymorphism taking over my code, and dynamic linkage creating a beautiful artwork of run-time resolutions. For those of you who don't know what that means, and have already had experience with an object oriented language, it's time you step back and wonder “do you really know how your code is working?”
Il y a quelque chose dans le ANSI-C qui empêche beaucoup d'entre nous de le lâcher. Avec l'arrivée de langages de programmation tels que Python ou Java, beaucoup se sont demandé si ça valait le coup d'apprendre C. Ou, pour beaucoup plus, si C était aussi puissant que ces langages relativement nouveaux.
Quand j'essaie de décortiquer ce que signifie réellement la puissance, je trébuche sur des choses telles que un bibliothèque de modèles standard, la portabilité, etc., mais le point qui retient avant tout mon attention est l'orientation objet. Je pensait qu'il serait impossible d'implémenter des choses telles que les niveaux d'abstraction de l'héritage ou du niveau de classe dans un langage comme C, mais, ensuite, je suis tombé sur ce livre appelé « OOC ».
What makes the book great altogether is that it is freely available. You can get a copy from https://www.cs.rit.edu/~ats/books/ooc.pdf, and start exploring the real power of C. Also the books spans just 221 pages. Before reading this book, projects with large numbers of files would scare me. If the file count went anywhere above five or six, I found myself perplexed by the complex distribution of work into modules. But now, I am working on projects with a minimum of 25 files. I understand it all now. The book often demarcates a conceptual topic into its 'type, api, and implementation' which makes working on big projects really easy. Once you learn to work with multiple files, it becomes easier to read code that others write because they would often do the same.
The other specialty of this book is that every second or third chapter in the book is a fully fledged example of an application built using the concepts learned in the previous chapters. Dedicating an entire chapter to an example helps to explore it in detail. At the end of such chapters, one can expect to find exercise questions which build upon the application being worked on. At the end, the book also provides hints on awk programming - a pattern scanning and processing language.
Table of contents is as follows: Abstract Data Types — Information Hiding Dynamic Linkage — Generic Functions Programming Savvy — Arithmetic Expressions Inheritance — Code Reuse and Refinement Programming Savvy — Symbol Table Class Hierarchy — Maintainability The ooc Preprocessor — Enforcing a Coding Standard Dynamic Type Checking — Defensive Programming Static Construction — Self-Organization Delegates — Callback Functions Class Methods — Plugging Memory Leaks Persistent Objects — Storing and Loading Data Structures Exceptions — Disciplined Error Recovery Forwarding Messages — A GUI Calculator