5

is there Disadvantage of using boost library?

For instance, The output binary file will be larger. or the performance is slightly lower than custom library.

Because Some large project doesn't use boost library instead of their own. So I'm thiking there 's reason why they don't use boost library.

Sungguk Lim
  • 6,109
  • 7
  • 43
  • 63

3 Answers3

4

A few points:

  • In general a dependency on a library or set of libraries is always a problem. It makes you have to shuffle around more code, it complicates cross platform building, it can complicate deployment etc. Often it's worth the effort since boost is solid cross platform code but sometimes it's not.
  • Boost uses a lot of templates. This is powerful but it can also be a source of hard to understand compilation errors etc. If you are working with old fashioned developers it may be better to work with a less modern subset of c++ just to make sure everyone is on board with how to fix the problems that show up.
Laserallan
  • 11,072
  • 10
  • 46
  • 67
2

I agree what Zhuge (3509) has answered here:-

One disadvantage I can think of is that if, for some reason, you need to tweak the code to fit your purpose, you would need to head in a read and understand a lot of it. If you write the code yourself, this is naturally unnecessary.

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
1

Being tied to a third party plugin is not always the best solution. It usually offers a very general solution that will work for many problems, but you may be able to improve on that if you have a very specific task that you need to work on. The time spent learning how an external library works could be put toward developing your own solution also. Anothing thing to consider is you may only need a tiny portion of the library, so as others have stated it may make your executable larger. To some that may not be desirable.

Tom Swifty
  • 2,864
  • 2
  • 16
  • 25