Live data from Hacker News

GitHub Code Search – Programmers' Goldmine

jakubdziworski.github.io

61–63 of 63 posts

Re: GitHub Code Search – Programmers' Goldmine

#61
post #35

It can be difficult to verify the quality of code in GitHub. Even well know products that work really well can be implemented with awful code. I suspect the vast majority of projects on GitHub are experimental and unfinished. Using this feature would be very unlike a system like Stack Overflow where there are strong incentives to provide good answers. Still, if the user is aware of these pitfalls then it could be qui…

what do you mean difficult to verify the quality of code? you are looking at the code.

In this context, when you look at the code you are trying to learn how to use an unfamiliar API. So you can't verify that the code is using the API correctly or in the most efficient, organized, and secure manner, because you don't yet know everything the API offers.

For example, maybe the code sample has a section that formats and saves the result to a file using the standard library. From looking at that section, you have no way of knowing that the library offers a .saveToFile method that would have been better to use instead. Or if you search for "mysql" examples in PHP, you may find example usage of the hard-to-secure, deprecated mysql_real_escape_string function instead of the PDO library that is supposed to replace it.

Re: GitHub Code Search – Programmers' Goldmine

#62
post #2

This is what I've been using as of late to learn new technologies. I always seem to forget to tell younger developers about using this approach to learn. Something else I would add is that you should try to find well known OSS contributors that work on projects that use tech/languages you use. If you monitor their projects you can pick up great habits from reading through their code.

Sounds like a great approach. Can you (or anyone else) recommend contributors to follow?

I've found that the following authors have great practices for managing OSS projects:

- https://github.com/mbostock

- https://github.com/tj

Post reply on HN