Great question. CodeExchange is intended to help you reformulate your query. That is, as you get results, it aims to help you change your query so the next results are closer to what you want.
Some typical use cases are finding API usage examples and algorithm implementations. This could mean finding code that invokes API methods, extends a parent class, implements an interface, implements depth first search or merge sort, etc...
Some examples:
[Looking for regular expression code]
An example may be issuing a keyword search “regular expression”, then taking the recommendation “[imports library] java.util.regex.pattern” to find code that uses this library, and then clicking on the method call “Pattern.matches” in a code result in order to return code that calls this method.
[looking for Minecraft code]
Another example may be issuing the keyword search “minecraft map” and then taking the recommendation “[keywords] world” to help disambiguate the word “map” from other meanings in Java.
[looking for merge sort code]
Yet another example could be issuing the keyword search “merge sort” and then getting empty class results. Since algorithms have logic in them (loops, if statements, etc...) you can critique the result by clicking the up arrow above “complexity” in order to get results with more logic in them.
These examples don't have to start out with keywords, however. Sometimes you are working with a team that already has libraries being used and you have to learn how to use them. To specify them up front you can use the “Advanced Search”
The search history is intended to support reissuing queries that worked in the past, to find code you need today.
Thanks for your interest! Let me know if I can answer any other questions or clarify anything. If you have time please fill out the survey on our site to help our research!
Interesting. It looks like its actually parsing the Java to produce the results as a search for "bing" shows the number of imports and complexity of the code. This would be similar to sourcegraph.
I wonder what parser is used and if it can be applied to other languages.
Good observation! We are continuously expanding our efforts, and will be looking into supporting other languages soon. For us, this will mean using or writing different parsers for different types of languages. Suggestions for which languages you want are appreciated! More details on the engineering of CodeExchange are being written.
Interesting. This is a university project yes? Will you be looking to open source some of the code, in particular the language parsers.
I ask from a purely selfish purpose as I want to integrate this sort of information into searchcode.com and would prefer to avoid writing my own implementations.
We are continuously expanding our efforts, and will be looking into supporting other languages soon. Suggestions for which ones you want first are appreciated! Thanks (zot zot)!
Great question. CodeExchange is intended to help you reformulate your query. That is, as you get results, it aims to help you change your query so the next results are closer to what you want.
Some typical use cases are finding API usage examples and algorithm implementations. This could mean finding code that invokes API methods, extends a parent class, implements an interface, implements depth first search or merge sort, etc...
Some examples:
[Looking for regular expression code] An example may be issuing a keyword search “regular expression”, then taking the recommendation “[imports library] java.util.regex.pattern” to find code that uses this library, and then clicking on the method call “Pattern.matches” in a code result in order to return code that calls this method.
[looking for Minecraft code] Another example may be issuing the keyword search “minecraft map” and then taking the recommendation “[keywords] world” to help disambiguate the word “map” from other meanings in Java.
[looking for merge sort code] Yet another example could be issuing the keyword search “merge sort” and then getting empty class results. Since algorithms have logic in them (loops, if statements, etc...) you can critique the result by clicking the up arrow above “complexity” in order to get results with more logic in them.
These examples don't have to start out with keywords, however. Sometimes you are working with a team that already has libraries being used and you have to learn how to use them. To specify them up front you can use the “Advanced Search”
The search history is intended to support reissuing queries that worked in the past, to find code you need today.
Thanks for your interest! Let me know if I can answer any other questions or clarify anything. If you have time please fill out the survey on our site to help our research!