Lurker News

Comments (684) 147 threads

Show all comments

Showing thread 3 of 147

stupidcar5 replies#
One of the best uses of GitHub is being able to search for some obscure framework method name or enum constant, and find examples of working code that uses it. This has saved my life many times when trying to figure out how to configure Java frameworks to interact with each other.

When searching for this kind of code, you have to wade through an awful lot of repos containing half-baked personal projects, experiments, unmodified clones of upstream frameworks, and barely-modified boilerplate examples. It would be nice if there was less of this detritus clogging up the search results.
However, sometimes the code you actually want is embedded in some otherwise useless, half-baked personal project, or barely-modified boilerplate example. So if all these projects disappear behind a veil of privacy, maybe it won't be a net win.

jmuhlich4 replies#
Honest question: how do you make github search work for you? It often fails to find stuff that I know exists in a given repo. Nothing fancy, even single-word full symbol names.
mschuetz1 reply#
I've found usefull code snippets on github via google in the past.
koheripbal#
How do you search for those exactly?
ak217#
What you describe used to be a problem years ago, but since they updated their search to its current iteration a year or two ago, I have had no issues finding exact string matches in repos. Can you give an example of a repo and a search that fails?
jcolella#
I cannot agree more with this. I love being able to search and see how libraries are being used in real life projects. It definitely helps.
Vekz#
I have also experienced this phenomenon. Finding some brilliant hack used in a randos personal project to work around a bug or deficiency in a popular library.

Finding a library with no documentation then Searching GitHub to see personal projects where the owner has already reverse engineered and integrated.
I always admired Github for incentivizing public repositories to promote collaboration and open source. Would hate to see that fade away.

jenscow1 reply#
Perhaps that's how they're killing OSS?
arcturus17#
Surely this is sarcasm.
EnderMB#
This is the killer feature of GitHub for me. When learning a new language, being able to sense-check your code against what someone has done in the past has helped me understand how and why some things work the way they do.