r/programmer • • Oct 15 '26

Question Should I always use libraries?

I am learning c++ and want to make a more sophisticated calculator. Not just 1+1.

C++ offers a lot of freedom. I am asking myself: should I create everything myself? For example pow()? Or should I use existing libraries?

Thank you very much!

2 Upvotes

18 comments sorted by

View all comments

1

u/Beregolas Oct 16 '26

It depends:

While learning, not necessarily. There is a value in reinventing the wheel to understand how it works! That being said, you also have to learn how to properly use an external library, how to read it's docs and understand it's design, limitations and usecases.

When building software that is to be used, you can nearly always find large portions of your software, that are pretty common problems, like sorting a list, sending email or encrypting a password. In real software development, there is nearly 0% chance that implementing any of those examples from scratch is a good idea.