Google indexing code patterns (Re: lexical for-in/for-of loose end)

# Herby Vojčík (14 years ago)

Erik Arvidsson wrote:

I agree with Brendan, I think we can get rid of the initializer even for for-in with var. The only code I've seen that uses this is in ES test suites.

Just an idea. Google crawls over the whole (crawler-accessible) web. That means it is indexing a lot of .js files out there.

I saw questions like the one above appear more times on this list. How often is [insert-your-own-quirk] used / is it used ever? Code files are of defined structure, unlike people-written documents. If Google would be able to index code files with some added information that allows to search in that structure, it could yield important information about usage patterns of this or that programming language.

# Nadav Shesek (14 years ago)

Google's code search allows searching for regular expressions. Perhaps that could be useful.

Sent from Android

# Sam Tobin-Hochstadt (14 years ago)

Google Code Search is no longer available, sadly.

# Nadav Shesek (14 years ago)

On Jan 31, 2012 3:38 PM, "Sam Tobin-Hochstadt" <samth at ccs.neu.edu> wrote:

Google Code Search is no longer available, sadly.

Oh, I didn't know it was shutdown. Hopefully some Google internals can still use that data to give some stats when those questions arise...

# Erik Arvidsson (14 years ago)

I did a code search for "for (var ident =" before code search was shut down and the only code it found was from test suites.

# Andrea Giammarchi (14 years ago)

I think it would be "semantically" correct to allow at least "let" there as it is for loops

for (let i = 0; i < length; i++); // OK

for (let key in obj); // not OK ?

weird, I know destructuration is OK but for/in are still for loops

my 2 cents,

br

# Erik Arvidsson (14 years ago)

Sorry, the search was a lot more elaborate to include "in" too.