Searching for symbols via Google is hard
Hokay. Google is without a doubt the single most useful and successful tool ont’Internet, a marvellous success story and something most of us would miss deeply until the happy day it’s superseded by something Even Better. It’s fast, it’s got a nice simple interface, and most of the time it “just works” and gives you what you want.
Unfortunately, some of the time, it really doesn’t “just work” (for me, at least) and in an apparently non-fixable way. I usually hit this when I’m doing programming-related searches.
For example, times is the name of a commonly used method in Ruby. Suppose we want to find out how it usually works, and maybe see an example… Googling for ruby times, what do we get? Well, Google has “intelligently” turned “times” into “time”, so we get lots of hits about the Time module in the standard library. D’oh!
Now, we can get round this: putting double-quotes around the word “times” forces google to take it literally, as does prefixing it with a +.
However, the situation’s trickier when it comes to symbols – which can be a real pain for programmers. Google simply strips out most (but not all) non-alphanumeric characters, as far as I can tell. One can grudgingly admit that that’s quite sensible in terms of indexing the Mobybytes of data on t’Internet, but sometimes it does bite one in the ass…
To pick an extreme example, maybe we want to know about the $\ operator (in Ruby, again). Googling for ruby $\, the $\ gets stripped completely, and we get the same results as just googling for “ruby”. Bah! Quoting doesn’t help here, either. Not all symbols are stripped, though: googling for ruby $_ is quite successful (update: ooh, actually, no it isn’t – the first hit just happens to include a $_ in the summary?). Parentheses are stripped, however, even with quotes – yicks! And echoing an earlier example, what if we want to search for +? (Or ++?) There’s just no way! Quoting doesn’t help, putting a + in front doesn’t help, putting it in quotes and putting a + in front of that doesn’t help… :-)
This is sometimes very frustrating. If the advanced search had an option for “really do search for exactly what I say, please” that would be nice, but alas, it don’t. Sometimes, it seems, you just have to get imaginative.
So: does anyone know a way round this? Or a better search engine to use when this bites?
13 Responses to “Searching for symbols via Google is hard”
Leave a reply
You can use HTML, but you don't have to. Formatting tips (for code, quotes, etc.) here.
A way round this – use Python instead. Far fewer symbols. ;-)
Have you come across Krugle? A few sample searches from your post bring back some bits which look (potentially) relevant.
Simon: true, but try searching for __foo__ for appropriate values of foo. :-) I’m sure that’s got me in the past. And as much as I love python and it will always be my First Favourite Programming Language, I have to say, I’m getting sucked deeper and deeper into Ruby. Avoiding horrid Perlisms is a virtue to be cultivated however – yes!
Dave: I hadn’t, and yay, it looks funky. Although, it didn’t seem too successful with $\ or $_ when I tried it…?
I have the same problem. I can’t figure out what the symbols are in the code, and I can’t search them either.
yeah, this is stupid.. im trying to learn about a hacker called \’)/* you try googling that.
Its just stupid, and iv been trying to google the aswer to this Q for the last hour.. nothing.. this page is what came closest, simply by being relevant.
APRIL 18,2009.
I WANT TO GET SYMBOL(LOGO) OF GOOGLE SEARCH ENGINE,BUT CAN’T…..SO,PLZ GIVE ME TRICK TO DOWNLAD IT……
I M WAITING UR REPLY…….-RAVI JODHANI(AHMEDABAD)
GUJARAT
INDIA.
Jesus, why do you indians never read anything before asking questions? Sorry, tech support bitterness here :P
I’m not gonna lie, that may be the funniest interjection i have ever seen in a web posting.
ravi calm down. start by releasing caps lock. then using proper grammar. then read the article. simple.
I know exactly what you mean. Just now I was trying to find information about the “->” operator in C++. And it’s impossible to search for in google. Driving me crazy. It’s just a simple little question that should be readily available via Internet search. Don’t know the difference between -> and the usual dot syntax I see in other languages. Google you failed me.
Copy of email just sent to previous poster…
I don’t know if you figured this out yet, but it’s actually quite simple. The distinction originates in C, not C++. Quoting from the C bible, K&R, section 6.2:
If you want to find out more, it might be worth knowing that “->” is called the “structure pointer operator”, and that “.” is called the “structure member operator”. If you google these terms, you’ll find lots more info.
It’s also always worth getting not just books, but _good_ books to refer to. Anybody using C should have K&R on their desk, and if you’re programming in C++, you’re using C enough that you won’t regret having a copy, IMHO.
Hope this helps!
You should try using http://www.symbolhound.com
[full disclosure: my site]
SymbolHound is a web search that does allow the special characters that Google ignores, such as @#$%^&*()=+[]\.
As stated in the article, Google ignores these characters, even if they are in quotes.
SymbolHound should be a useful tool for programmers!
Good luck
Tom, as someone trying to teach himself ruby, your site’s a godsend