Cover of C interfaces and implementations

C interfaces and implementations

by David R. Hanson · first published 1996

114mentions
46recommended by
63HN commenters
2008–2026first – last mentioned

72% recommend23% neutral5% critical

Why HN recommends it

Shows how to design reusable C libraries with clean interfaces, ADTs, and exception handling built on setjmp. Suits programmers who know K&R and want to learn API design and code organization.

Common criticism: Literate, comment-heavy code style can distract from the prose

Summarised by Claude from recommending comments

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

110 2007: 0 mentions2008: 2 mentions2009: 5 mentions2010: 11 mentions2011: 8 mentions2012: 6 mentions2013: 5 mentions2014: 3 mentions2015: 8 mentions2016: 9 mentions2017: 5 mentions2018: 3 mentions2019: 1 mention2020: 6 mentions2021: 1 mention2022: 4 mentions2023: 3 mentions2024: 3 mentions2025: 2 mentions2026: 1 mention200720172026

What Hacker News says

  • sramsay · Mar 8, 2020 · Recommends

    …exactly an up-to-date language resource at this point, and it doesn't really provide any guidance on the design and structure of systems in C (that's not it's purpose). You might have a look at Hanson's C Interfaces and Implementations: Techniques for Creating Reusable Software. That's focused on large projects and APIs, but it will give you a good sense of the "cognitive style" of C. 21st Century C is very opinionated, and it spends…

    on “Ask HN: How do I learn C properly?” ↗
  • jll29 · Oct 8, 2022 · Recommends

    …people who already know programming: Peter A. Darnell and Philip E. Margolis C - A Software Engineering Approach (3rd ed.) https://www.amazon.com/Software-Engineering-Approach-Peter-D... David Hanson C Interfaces and Implementations: Techniques for Creating Reusable Software (!st ed.) https://www.amazon.com/Interfaces-Implementations-Techniques... The first is clearly written and focuses on ANSI C (lexis, syntax and semantics),…

    on “Ask HN: Best book to learn C in 2022?” ↗
  • Maro · Apr 26, 2011 · Recommends

    …don't think this argument stands. There are just as many great C books out there: * C Programming Language - by K&R * The Indispensable Guide to C with Engineering Applications - by Paul Davies * C Interfaces and Implementations - by David Hanson * A Retargetable C Compiler: Design and Implementation - by David Hanson * Graphics Programming Black Book - by Abrash with lots of Quake goodies

    on “The myth of the Lisp genius” ↗
  • tptacek · Dec 21, 2011 · Recommends

    For the past 10 years or so, I've been using an alternative to printf() that I lifted out of Hanson's _C Interfaces and Implementations_; in my tree, it's "fmt.c", and includes the family of fmt_<star> functions. They're just string processing code, and so are trivially portable to WinAPI, OS X, Linux, and FreeBSD. This is so…

    on “ISO C is increasingly moronic” ↗
  • tptacek · Mar 23, 2010 · Recommends

    C Interfaces and Implementations by Hanson. It'll give you back most of the things you depend on in Python, like variable length strings and dictionaries. I'm teaching a 4-month weekend C class for Ruby programmers starting in April,…

    on “Ask HN: I use and love Python. What's the best book to learn C ?” ↗
  • tptacek · Apr 6, 2010 · Recommends

    _C Interfaces and Implementations_ by David Hanson. I'm using it as the textbook for a weekend C class I'm about to run for a bunch of Ruby/Java programmers, because CII basically gives you back all the data structures you have in Ruby…

    on “32 years on, K&R's "The C Programming Language" still stands alone” ↗
  • kqr2 · Sep 11, 2010 · Recommends

    I would recommend David R. Hanson's book C Interfaces and Implementations. It is an extremely well documented library and shows you how to design APIs properly. http://www.amazon.com/Interfaces-Implementations-Techniques-...

    on “Ask HN: Examples of especially well-written C code?” ↗
  • mahmud · Apr 26, 2009 · Recommends

    …header file and Make dependency problems, a few unix and processor portability problems and a few other stuff. The solution to those problems along with a fat library of useful routines are found in "C Interfaces and Implementations" by Hanson. It's a literate programming text where source code is interwoven with prose documentation and it's very self evident. Along with productive C programming you might need to look into the darker…

    on “Ask HN: Learning C” ↗
  • plinkplonk · Sep 18, 2009 · Recommends

    …books that expose how great hackers use that language and are targeted towards people really trying to master the language, eg: Common Lisp has PG's On Lisp and Peter Norvig's PAIP, C has David Hanson's "C Interfaces and Implementations", Forth has Leo Brodie's books and so on. Many other languages, even very popular ones, don't have these intermediate-to-expert level books written by outstanding hackers and are restricted to "Introduction…

    on “Rich Hickey's Clojure Bookshelf” ↗
  • plinkplonk · Oct 13, 2009 · Recommends

    …example, have Open Source code we can look at learn from. The best code I've seen: - Common Lisp - "Paradigms of Artificial Intelligence Programming" by Peter Norvig and "On Lisp" by Paul Graham C - "C Interfaces and Implementations" and "LCC- a compiler for ANSI C" both by David Hanson. I also found the code for the Player/Stage robotic sim framework surprisingly readable. I liked the Scala Actors library code as well. If any…

    on “Ask HN: What source code is worth studying?” ↗
  • tptacek · Oct 24, 2009 · Recommends

    My favorite C book is "C Interfaces and Implementations" (CII) by Hanson. It's an excellent bridge from Perl/Python to C; in particular, it gives you resizeable arrays and hash tables, which are the two things you will miss most from high level languages.…

    on “Learning C and ASM, what's the way to go?” ↗
  • silentbicycle · May 7, 2010 · Recommends

    …and Pitfalls_. Heck, the article (http://www.literateprogramming.com/ctraps.pdf) that grew into the book is even free online. Also, for anybody doing modern C work, I strongly recommend both Hanson's _C Interfaces and Implementations_ and Ierusalimschy's _Programming in Lua_, 2nd ed. The former nails writing good C libraries, and the latter covers one particular library that provides a portable, C-friendly, mature, efficient (http://luajit.org/),…

    on “C Language Quirks” ↗
  • zvrba · Jul 16, 2010 · Recommends

    …see, C is a really small language and "learning it in depth" includes learning arcane rules, such as what constitutes undefined behavior, what names are reserved, etc. I would recommend reading the "C Interfaces and Implementations" book by David Hanson. Another book that I'd recommend is "Expert C Programming (dark C secrets)" by van der Linden.

    on “Ask HN: An Advanced C Tutorial” ↗
  • silentbicycle · Sep 7, 2010 · Recommends

    While it's ostensibly about C, David Hanson's _C Interfaces and Implementations_ (http://sites.google.com/site/cinterfacesimplementations/) has a lot of good discussion about API design for libraries, how to handle errors gracefully, etc. Many points apply just as well to libraries…

    on “Ask HN: Best books in API design” ↗
  • defen · Nov 5, 2010 · Recommends

    C Interfaces and Implementations is really good: http://www.amazon.com/Interfaces-Implementations-Techniques-...

    on “What do you want to see in Learn C The Hard Way?” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help