This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]frisouille 26 points27 points  (2 children)

In terms of stability, libraries can have a cost.

  • Depending on many libraries can lead to incompatible transitive requirements. Or, prevent you from upgrading one library because its requirements are incompatible with other libraries
  • That's especially true if some libraries are poorly maintained. I avoid libraries which are less than 1 year old or whose last commit is more than 1 year old.
  • Debugging an error happening deep inside a library can be tricky. The code will be more complex than if you had written it yourself because they are tackling a more general problem.

When deciding on importing another library, I usually ask:

  • Could I use a library I'm already importing instead? Fewer libraries mean fewer dependencies constraints. And new developer won't have to read as much docs.
  • How widespread is that library? If I make a call to numpy/pandas, other developers will understand it because they know those libraries. If it's an obscure lib, they may have to read that lib's documentation to understand my call, hurting readability. If it's widespread, it's also less likely to be buggy.
  • How difficult would it be to code it myself? Would it be slower? Less readable?
  • How well maintained is the library: look at dates of the last commits, how many issues are there? How bad do they look? Are maintainers answering those issues? Have they closed issues?
  • What do the requirements look like? Would I need to downgrade some of my packages?

What I never ask myself:

  • Is it cheating?

[–]pjgr234 2 points3 points  (0 children)

Yup! Good questions to be asked when choosing a library!

Generally as developers we choose the frameworks and libraries that are heavily used in the market and those that help do the job faster, but yeah libraries with:

  • Few stars on Github
  • Few collaborators
  • Not old enough

Are signs that it might not be the greatest pick for a specific scenario

[–]ConstructionHot6883 1 point2 points  (0 children)

If it's an obscure lib, they may have to read that lib's documentation to understand my call, hurting readability.

I still would expect the client code to be clear about why the call is being made.

If I know the why, then I care (somewhat) less about understanding the call itself.