4 ms·
that's a common pattern in C++ land because there is no standard way to use libraries in C++ https://github.com/p-ranav/awesome-hpp https://github.com/p-ranav/
by socalgal2 8mo ago
that's a common pattern in C++ land because there is no standard way to use libraries in C++
https://github.com/p-ranav/awesome-hpp https://github.com/p-ranav/awesome-hpp
- pjmlp 8mo agoIt is a common pattern among those that don't want to learn build systems, which isn't exactly the same.
- capisce 8mo agoOr among those who want to support any build system
- pjmlp 8mo agoWe managed during the last 20 years just fine.
- socalgal2 8mo agoIn my experience. I've run into the issue quite often. You find some library, it has its own build system (meaning not the one you're using). It has special rules etc... Integrating into your build system is time consuming and frustrating. Compiler errors from includes, linker errors, etc.. None of that happens with a single file C++ library.
- pjmlp 8mo agoYeah, and? There isn't a single build system without issues, other than siloed languages without language standards. Header libraries only started to be a thing when scripting generation educated in Python and Ruby during the 2010's turned into compiled languages.
- tw061023 8mo agoThat's... definitely a way to describe Sean Barrett, whose excellent libraries popularized this style.
- chris37879 8mo agoAnd what build system do you recommend the entire ecosystem support? Well, I choose (arbitrarily different and incompatible one to prove a point). Do you see the problem?
- pjmlp 8mo agoI see a learning problem, because there is hardly a programming language in widespread use using a single one. And if you're going to point out Go or Rust, it kind of works as long, nothing else is used, and they don't need to interact with platform SDKs.
- CyberDildonics 8mo agoEverything is easier with single file headers. This idea that a build system and single header libraries are mutually exclusive is silly. You can take multiple single file libraries and put them into one compilation unit. Then you have minimal files and minimal compilation units. Compilation is faster, everything is simpler.
- pjmlp 8mo agoWhat is silly is pretending everything is a scripting language.
- CyberDildonics 8mo agoI don't know what that is supposed to mean and I don't think it means anything. I'm talking about real pragmatic benefits and you're making some vague hand wavy judgement without any tangible explanation.
- on_the_train 8mo agoI wrote a mildly popular header only library with exactly this pattern once. Then there came a guy adding cmake. I didn't really know it back then so I didn't stop him. The downloads went to literally zero lol. Cmake is an extremely vocal minority.
- pjmlp 8mo agoWho said anything about cmake specifically?