logoalt Hacker News

pjmlptoday at 9:33 AM1 replyview on HN

If at least C solutions took advantage of abstract data types as advocated by modular design approaches before OOP took off, but no it is all reaching out to field data directly with macros, and clever pointer tricks that fail down.

There are several books on the matter, that obviously very few read.

Here one paper example from 1985 on the subject, "Modular programming in C: an approach and an example"

https://dl.acm.org/doi/10.1145/382284.382285


Replies

rramadasstoday at 2:20 PM

> If at least C solutions took advantage of abstract data types as advocated by modular design approaches

People have been writing C code with ADTs and "Modules" from the very beginning.

Two excellent examples which come to mind are; Andrew Tanenbaum's Minix book Operating Systems Design and Implementation and David Hanson's C Interfaces and Implementations: Techniques for Creating Reusable Software.

And of course the Linux Kernel is full of great modular C techniques which one can study.

show 1 reply