For example, say there is a library which does what you want. Is it worth spending your time to solve the same problem in your own way?
in general it's always worth to understand what's happening and without reading or solving the same problem you never know why decisions are made ...
which is called blackboxing ... and as a rule of thumb -> we don't wanna blackbox because it means to assume and in the end we want to assert ... because otherwise we're just guessing and not knowing.
On the other hand if you ask me, if you should use your self-coded lib afterwards .... I actually would not :) unless you want to maintain it yourself :).
Mev-Rael
Executive Product Leader & Mentor for High-End Influencers and Brands @ mevrael.com
This is exactly how you learn as a software engineer by hacking your brain all the time. Solve many problems every day, solve them again, recognize patterns, see bigger picture, merge, optimize, clean, study other solutions, compare, repeat. Learn from as many independent resources as possible and never trust only one or two.
P.S. It doesn't mean you should waste all your time reinventing the wheels and learning at your job. In real life if there is a 3rd party solution which fits your requirements, then use it, however, at the end of your day, evening and weekends you may study and become better in whatever you want. After many years you will understand that most of 3r party solutions are implemented not very good and you will have experience and knowledge to implement those solutions better while you won't have much free time as you have now, so you will start respecting your very limited and expensive time and still will have to use ready solutions even if they are not perfect.
It's all about simple math. You write own solution from scratch only if total sum of the design, development, maintenance, documentation costs will be < then same sum + (re)learning curve + λ (how stable 3rd party solution is, how often it changes and introduces breaking changes) for 3rd party code.