Skip to content

Comment on Show HN: Header-only GIF decoder in pure C – no malloc, easy to useparent

Comments

At that point, what does header-only gain you in C (ie not C++)?

I've included many single .h/.c pair libraries before in my projects and given the of simplicity that was never a pain point.

people who have to support windows do this sometimes because MS has gone for almost forty years now without ever specifying a default directory where libraries go. This is in spite of the fact that being the creator of the OS, the most-popular compiler, and the SDK should in theory give them enormous leverage to dictate where dependencies get saved.

There's this bizarre cultural difference you see between people who learned to program on windows compared to people who learned to program on unix wherein the Windows crowd don't see the value of having an easily reproducible build system because. Usually this results in some combination of needlessly-complicated scripts and checking binary builds of dependencies into version-control.

Requiring you to include a header-file while also defining a specific constant in only one place that turns the header file into a c-file is actually one of the more benign workarounds you see.

Outside FOSS UNIX clones, most OSes, including commercial OSes, tend to have a more diversified ecosystem in compilers, and which directories those compilers take their libraries from.

Naturally people love to complain about Windows.

Also nowadays there is vcpkg and conan.

Been a good while since I worked with C/C++, but when I did it was on Windows.

As I recall I just added the files to the project, possibly configured a define or five, and then compiled.

Tedious when it's tons of directories, but a breeze with just a pair of files.

That said, I get that this buys you a bit of flexibility in build management.

Not learning about how compilers, linkers and library managers actually work.

Even C++, and considering templates, if you want to use external templates optimization you need implementation files, and then there are modules (already working in clang/VC++).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.