Live data from Hacker News

GitHub Code Search – Programmers' Goldmine

jakubdziworski.github.io

41–50 of 63 posts

Re: GitHub Code Search – Programmers' Goldmine

#41
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.

Re: GitHub Code Search – Programmers' Goldmine

#42
I still think that Google Chromium code search repository is by far the best one I've seen. Things like following refs everywhere and seeing git blame and related files makes it a hell of a lot better than github. https://codesearch.chromium.org/chromium/src/components/inva...

Re: GitHub Code Search – Programmers' Goldmine

#43
post #42

I still think that Google Chromium code search repository is by far the best one I've seen. Things like following refs everywhere and seeing git blame and related files makes it a hell of a lot better than github. https://codesearch.chromium.org/chromium/src/components/inva...

FYI, part of the tech stack behind that is open source: https://www.kythe.io/

Re: GitHub Code Search – Programmers' Goldmine

#44

Earlier quoted context omitted.

Have you checked out out https://sourcegraph.com/ ? It has awesome code search and navigation for github.

Kind of expected that you would be able to search all of GitHub there but it seems to be limited to selected libraries and your own repos? Also, surprised that C is not supported.. Personally I'm using GitHub's code search to discover dumps of code and docs for random Chinese hardware (SBCs and such). I've found it much easier than trying to find SDKs on Baidu's file sharing site (Baidu Pan).

Sourcegraph CEO here. We need to do a bunch of language-specific stuff to make search work well for finding definitions and usage examples, so we've scoped it for now. But we're almost ready to add more languages and index all repositories; check https://sourcegraph.com/beta to get early access and to +1 your preferred languages. This is the #1 request we get, and we can't wait to have Sourcegraph work for all code and more languages. :)

Re: GitHub Code Search – Programmers' Goldmine

#45
This is, indeed, cool. However, be aware of the legal ramifications of viewing and using other people's code. From copyright license problems to having your proprietary code "tainted" (it's a legal concept that seems to say that you can infringe on IP even if you don't copy the code directly, something management at Microsoft apparently thinks about regularly), there's a lot to be aware of in today's litigious environment.

Re: GitHub Code Search – Programmers' Goldmine

#48

as great as it is to be able to search source code in github is, it is equally (if not more) frustrating. I think it works fine for simple searches mentioned in the post, but anything even slightly more advanced doesn't work very well. I also wish there was a way to search in branches other than master

There's also the limitation that some characters [1] are ignored, which makes it improbable you'll find what you're looking for.

Apparently this is related to how the search index works, but cumbersome nevertheless.

[1] https://help.github.com/articles/searching-code/#considerati...

Re: GitHub Code Search – Programmers' Goldmine

#50
post #21

I've been using GitHub code search to let other Python programmers know about the % string formatter. I search for ".2f}%'.format(100" and then send a push request to simplify the code. See https://github.com/EdwardBetts?tab=overview&from=2016-04-19

This makes me think... maybe this could be generalized into a linter-as-a-service that occasionally submits pull requests for obvious style wins. Maybe just commenting on existing pull requests to be less annoying (and because there's a better chance it can be fixed by the issue opener).
Post reply on HN