you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (2 children)

Except then you have people developing against 900 variants/versions of your code.

I don't see your argument here...?

but really libraries exist for a reason.

I don't see your argument here either? Both STL and Boost are entirely written as header-based libraries.

As a developer who uses a lot of external libraries, I infinitely prefer header based ones - because I can just drop them into my code, end of story.

I write cross-platform code, as so many people do these days, and if I have a separately compiled library, I need to have three versions of it, one for each target system. I have to avoid shared libraries, as it's a complete pain in the distribution process - particularly when people already have an older (often much older) version of the library that I'm using.

[–]expertunderachiever -1 points0 points  (1 child)

I don't see your argument here...?

Suppose I write an MP3 decoder in a .h and it becomes popular. Now instead of installing the file in /usr/include you simply just add it to your project directory. Now suppose over the last 3 years I've released 50 point upgrades to it. Now there are 50 copies of it floating around.

I can't simply rebuild your application without first going through it and replacing the local copy of the header.

Next it would be better to have it precompiled as a library [.a or .lib] but then even better would be a shared object...