Question

Many a time do I find myself pointed out to use some code in some github repository, and I find it hard to asses whether I should trust and use the code.

Assuming The code is an answer to my visible needs, what other parameters should I check in order to decide if using the code is a good idea?

Was it helpful?

Solution 2

You can check out the chrome extension DevGib that I wrote. It automatically rates Stackoverflow questions and Github repositories before accessing them, by showing a small colored icon next to the link. It's still work in progress but it does the job for me.

OTHER TIPS

You should check:

  • documentation - Is everything clearly documented? Would you need support from the author to use the code?

  • activity - Sometimes authors could not constantly push updates to the library, but it is important issues and pull requests are resolved rather quickly. Common bugs often are resolved by others in a pull request, but if it's not merged it's rather hard to handle all the forks.

    Also you should check the Pulse page in the repo. It will show the activity in issues, commits and releases.

  • extensibility - You may want to do something different with the library. Or you may want to build something on top of it. You should check the API (the public interface), the configuration and whether some components could be changed with something else (think interfaces and the composite design pattern).

  • tests - Unit tests are important. You should write tests for your own application. When you use an external library, make sure it is well tested so you use a component which will work the same when you update it or use it in a different environment. If the code is not tested you should not use it. Unless you wrote the tests yourself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top