Outils pour utilisateurs

Outils du site


issue115:critique_litteraire

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 commencent à se demander si ça vaut le coup d'apprendre C. Ou, encore plus important, C est-il aussi puissant que ces langages relativement nouveaux ?

Quand j'essayais de décortiquer ce que signifie réellement être puissant, j'ai découvert des choses telles qu'une bibliothèque de modèles standard, la portabilité, etc., mais le point qui retenait avant tout mon attention était l'orientation objet. Je pensais 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 ».

Je n'ai jamais, jamais, lu un livre comme celui-ci. Ce qui le rend spécial, c'est que, plutôt que de vous balancer la syntaxe d'une pseudo-classe, il plonge au plus profond de la notion d'abstraction. Pour la première fois de ma vie, j'étais capable de ressentir le polymorphisme soutenant mon code et les liens dynamiques créant un beau motif de décisions d'exécution. Pour ceux d'entre vous qui ne savent pas ce que ça signifie, et qui ont déjà eu une expérience de la programmation orientée objet, c'est le moment d'un retour en arrière pour vous demander « Est-ce que je sais réellement comment fonctionne mon code ? »

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.

Ce qui ajoute à la grandeur de ce livre, c'est qu'il est librement disponible. Vous pouvez en obtenir une copie par https://www.cs.rit.edu/~ats/books/ooc.pdf, et commencer à explorer la puissance réelle du C. Ce livre ne fait en tout que 221 pages.

Avant de lire ce livre, les projets avec un grand nombre de fichiers m'effrayaient. Si le nombre de fichiers dépassait cinq ou six, j'étais perplexe devant la distribution complexe du travail en modules. Mais maintenant, je travaille sur des projets avec au minimum 25 fichiers. Je comprends tout maintenant. Le livre délimite souvent un sujet conceptuel entre ses « type, api et implémentation », ce qui rend plus facile le travail sur de gros projets. Une fois que vous avez appris à travailler sur des fichiers multiples, il devient plus aisé de lire du code que d'autres ont écrit, car ils ont souvent fait la même chose.

L'autre particularité de ce livre est que tous les deux ou trois chapitres du livre, un exemple complet d'une application est construit en utilisant les concepts appris dans les chapitres précédents. Quand un chapitre entier est dédié à un exemple, ça aide à l'explorer en détail. À la fin de tels chapitres, vous pouvez vous attendre à trouver des exercices sous forme de questions qui s'appuient sur l'application en cours de discussion.

À la fin, le livre fournit aussi des conseils sur la programmation awk, un langage d'examen et de traitement de motifs.

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

Table des matières Types d'abstraction de données - Cacher les informations (Abstract Data Types — Information Hiding). Liens dynamiques - Fonctions génériques (Dynamic Linkage — Generic Functions). Économie de programmation - Expressions arithmétiques (Programming Savvy — Arithmetic Expressions). Héritage - Réutilisation et raffinage du code (Inheritance — Code Reuse and Refinement). Hiérarchie des classes - Maintenabilité (Class Hierarchy — Maintainability). Le pré-processeur ooc - Imposer un codage normalisé (The ooc Preprocessor — Enforcing a Coding Standard). Vérification dynamique des types - Programmation défensive (Dynamic Type Checking — Defensive Programming). Construction statique - Auto-organisation (Static Construction — Self-Organization). Délégation - Fonctions de rappel (Delegates — Callback Functions). Méthodes de classe - Colmater les fuites de mémoire (Class Methods — Plugging Memory Leaks). Objets persistants - Stocker et charger des structures de données (Persistent Objects — Storing and Loading Data Structures). Exceptions - Récupérer une erreur avec rigueur (Exceptions — Disciplined Error Recovery). Transfert de messages - Un calculateur en mode graphique (Forwarding Messages — A GUI Calculator).

issue115/critique_litteraire.txt · Dernière modification : 2016/12/15 15:18 de andre_domenech