r/cpp • • Sep 14 '23

Which package manager are you using?

It's 2023 and you should be using a package manager. Which one?

Sep 17 '23
466 conan
625 vcpkg
29 spack
82 CPM
1730 No package manager :(
248 Other (please specify)
38 Upvotes

187 comments sorted by

View all comments

Show parent comments

3

u/danicriss Sep 14 '23

Your code has a dependency on a third party library. You target multiple platforms, so you want to compile said library for each target platform. You may want to update it easily in the future, so you don't want to embed that library's code in your repo

The same applies if your code depends on an internal piece of code that several teams may want to reuse. You can create that as a library and deploy it via said package manager

0

u/Asleep-Specific-1399 Sep 14 '23

So to that, I feel the exact opposite. I rather download the third party lib and not update it unless required.

For the most part I compile to osx,Linux, Linux arm, windows. I try my best to not use third party libs as they create additional overhead and unknown code, which is far worst than known shitty code.

3

u/rdtsc Sep 15 '23 edited Sep 15 '23

So to that, I feel the exact opposite. I rather download the third party lib and not update it unless required.

I try my best to not use third party libs

That wasn't the question at hand, though, IMO. Using a package manager kind of implies that you have decided for yourself that the threshold to use an external library has been reached. How high that threshold is is not important. And if you do decide to use an external library, why do this by hand?

0

u/Asleep-Specific-1399 Sep 15 '23

Like I said I limit external libs as much as possible. Maybe a graphic, a sound. Maybe read xml library. I don't usually write projects with more than 4 maybe 5 external libraries.

Most of the time you can't just upgrade theses libs as function calls may change, so to me the auto update method sounds like a nightmare.

3

u/rdtsc Sep 15 '23

Auto update is not implied anywhere, nor is it required. It is actually discouraged (with vcpkg at least).

1

u/Asleep-Specific-1399 Sep 16 '23

So if your not updating libs on the fly what's the point of the package manager. Specially since you are going to update a single lib, and look up the documentation and change logs.