r/programming • • Sep 04 '26

Avoid adding new library to project: 10-year retrospective

https://pvs-studio.com/en/blog/posts/1408/
170 Upvotes

35 comments sorted by

View all comments

Show parent comment

89

u/Due_Cap_7720 Sep 04 '26

To keep with the analogy I think some libraries and frameworks are less like bricks and more like prebuilt homes. Too many decisions have already been made and trying to reconstruct them for your needs becomes counterproductive.

48

u/turtle_dragonfly Sep 04 '26

To me, this is one of the key distinctions between a "library" and "framework." The library is used by your code. Your code is driving. The framework uses your code. The framework is driving.

I do much prefer library-style 3rd-party code than framework-style. You can use lots of libraries, but using more than 1 framework is trouble town.

2

u/Finickyflame Sep 04 '26

That's also the way we go with our internal packages. Provide libraries/tools and don't try to control the way people work via frameworks. It's also easier to switch between libraries that offer similar features than to rewrite your application when you swap framework.

1

u/saastryde 5d ago

the framework trap is real. i've seen it kill projects where you spend months fighting the abstraction instead of shipping. stick to libraries that do one thing well.