Live data from Hacker News

Nuklear: A single-header ANSI C GUI library

github.com

11–20 of 186 posts

Re: Nuklear: A single-header ANSI C GUI library

#15
post #13

I really do not understand why 'single header' is considered a good thing, but I see this more and more often on libraries. What is the reason all the code is put in the header file?

because dependency management and build systems are hard to get right and not standardized. It's a simple distribution model that works everywhere.

Re: Nuklear: A single-header ANSI C GUI library

#18
post #13

I really do not understand why 'single header' is considered a good thing, but I see this more and more often on libraries. What is the reason all the code is put in the header file?

I would also like an explanation. The author(s) of Musl (libc alternative) mention on this page that it can potentially invoke undefined behavior: https://wiki.musl-libc.org/alternatives.html

However, having used a few of these "single-header" libraries my main concern is navigating a 9000 sloc header file as opposed to a neatly re-factored version...

An explanation of how undefined behaviour is possible would be welcome.

Post reply on HN