logoalt Hacker News

kazinatoryesterday at 6:49 PM3 repliesview on HN

In the world of Kubernetes and languages where a one-liner brings in a graph of 1700 dependencies, and oceans of Yaml, it's suddently important for a C thing to be one file rather than two.


Replies

jasonpeacockyesterday at 9:27 PM

C libraries have advertised "header-only" for a long time, it's because there is no package manager/dependency management so you're literally copying all your dependencies into your project.

This is also why everyone implements their own (buggy) linked-list implementations, etc.

And header-only is more efficient to include and build with than header+source.

show 2 replies
fonheponhoyesterday at 9:17 PM

Exactly; I can't understand this obsession with header-only C "libraries".

quotemstryesterday at 9:16 PM

Writing new C code in 2026 is already an artisanal statement, so why not got all the way in making it?