4 ms·
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.
by stupidcar 8y ago
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.
- jcolella 8y agoI 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.
- jmuhlich 8y agoHonest 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.
- malchow 8y agohttps://sourcegraph.com https://sourcegraph.com ?
- tex0 8y agoSame here. Does https://source.cloud.google.com https://source.cloud.google.com work for you?
- mschuetz 8y agoI've found usefull code snippets on github via google in the past.
- koheripbal 8y agoHow do you search for those exactly?
- ak217 8y agoWhat 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?
- Vekz 8y agoI 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.
- jenscow 8y agoPerhaps that's how they're killing OSS?
- arcturus17 8y agoSurely this is sarcasm.
- EnderMB 8y agoThis 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.