Tl;Dr:
As of November 2022, is Google still the best option to search for posts including specific code methods?
I'm trying to find questions with code generated by the Google Sheets Macro Recorder. OPs do not always mention that the code was generated using this tool. It could be "detected" as the automatically generated code very commonly has a lot of lines as the following examples:
spreadsheet.getRange(hardcode_a1Notation_reference).activate();
spreadsheet.getCurrentCell().setFormula(hardcoded_formula);
Another pattern
var currentCell = spreadsheet.getCurrentCell();
spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).activate();
currentCell.activateAsCurrentCell();
currentCell = spreadsheet.getCurrentCell();
I tried
- [google-sheets] code:activate() 55 results
- some results don't include
activate
, but not the parenthesis, and others include variants of theactivate
word, likeactive
not in code blocks / inline code.
- some results don't include
- [google-sheets] code:"activate()" 24 results
- includes results having
activate()
in inline code without having nothing else before or after
- includes results having
- [google-sheets] activate() 1,627 results
- No surprises: a lot results include variants of
activate
likeactive
- No surprises: a lot results include variants of
- [google-sheets] "activate()" 337 results
- A bit surprised as expected for exact / verbatim matches, a lot results include variants of
activate
likeactive
- A bit surprised as expected for exact / verbatim matches, a lot results include variants of
A comment from 2016 suggest to use an "insecure" website.
Replace the built-in Elastic Search with results from Google instead from 2014 and other more recent posts suggest that Google is better.
Related
- Why aren't we told we can use special characters in search? from 2017
- Search not finding methods in code searched for by name from 2017
- Tips for searching effectively on Stack Overflow - novice developer training from July 2022
After reading the Makoto's answer instead of searching around activate()
I tried searching a single line of code double-quote enclosed using Google:
"var currentCell = spreadsheet.getCurrentCell();"
then clicking on "more results from stackoverflow.com", that automatically adds site:stackoverflow.com
as expected. For an early approximation is good enough but the results apparantly were very similar (I didn't compared result by result, and didn't discarted "false positives").
Google returned 32 results including one from ru.stackoverflow.com
code:"var currentCell = spreadsheet.getCurrentCell();" returned 35 results
Both searches were done practically at the same time.
I just thought about code plagiarism checkers, so I tried to search
code plagiarism checker
The results includes several entries that looks interesting, but I will explore them later.
The following question includes four instances of spreadsheet.getRange(something).activate();
, where something
is 'K1'
, 'N1'
, 'P1'
, in code blocks but it's not included in the search results of [google-sheets] code:"activate()"
:
Another missing question in the previous search