Live data from Hacker News

Improvements to searching for special characters in programming languages

blog.google

21–30 of 30 posts

Re: Improvements to searching for special characters in programming languages

#21
post #20

Long due considering DuckDuckGo is quite developer friendly.

Agree. On DuckDuckGo just do:

!so

Takes your search directly to Stack Overflow

If you don't like the results, try it again with !g and your search is submitted to Google.

They've got 9000+ bangs now:

https://duckduckgo.com/bang?q=

Re: Improvements to searching for special characters in programming languages

#22
I am a bit sad that no Haskell results show up in this search:

">>= operator": https://www.google.com/#q=%3E%3E%3D+operator&*

But it's a sight better than it was before. It actually shows meaningful programming language results. And if I call the operator by it's Haskell name at the same time, I get very good results:

">>= bind": https://www.google.com/#q=%3E%3E%3D+bind&*

Or just the language name:

">>= Haskell": https://www.google.com/#q=%3E%3E%3D+haskell&*

Re: Improvements to searching for special characters in programming languages

#23

I am a bit sad that no Haskell results show up in this search: ">>= operator": https://www.google.com/#q=%3E%3E%3D+operator&* But it's a sight better than it was before. It actually shows meaningful programming language results. And if I call the operator by it's Haskell name at the same time, I get very good results: ">>= bind": https://www.google.com/#q=%3E%3E%3D+bind&* Or just the language name: ">>= Haskell": htt…

For your first search, I see "Operator Glossary - Haskell Lang" as the 9th result.

Re: Improvements to searching for special characters in programming languages

#24
post #19
post #8

This is great. I feel Google has slowly become too user friendly. My mobile results are always way less technical than my desktop results. If I'm in the car (passenger) and want to look up a problem I'm having while programming, I get mostly related queries that are a simplified version of what I'm looking for. I really believe that the technical crowd drives what becomes popular (app recommendations for family and f…

Google tailors its results to the kind of person it thinks you are. For example, if you immediately search "python", you will get results about snakes. But if you search for programming first, and then python second, it will now give back programming results on the second search. This continues to apply if you searched "programming" last week. This behavior is actually very nuanced and impressive to watch, once you u…

That specific example isn't actually true. Even with no prior history if you search "python" the first result is the programming language.

That's because Google is smart and despite the fact that more people know of Python as a snake, when somebody types just "python" into a search query, it's almost definitely true that they mean the programming language. Few people Google for types of snakes.

A similar thing is true for "ruby" and "rust".

Re: Improvements to searching for special characters in programming languages

#27
post #25

Meanwhile, code searching at GitHub completely ignores characters like =, $, {. And, it's case insensitive. Argh.

It's the most frustrating "feature" I've ever seen. GitHub, the platform for hosting code, has a search function that doesn't work for code. How does that make any sense?!

Fixing that seems like PM101 material, yet here we are in 2017 with this still being a thing...

Re: Improvements to searching for special characters in programming languages

#29

Earlier quoted context omitted.

When indexing documents (and querying for them), there is a process the terms go through, to split them up and then normalize them so they can be found easier. A trivial example is you want to find "can't" when someone searches for "cant". Typically special characters are removed for several reasons: the vocabulary of terms becomes smaller and saves space and time, you can ignore punctuation (like searching things th…

OK, thanks - that sounds plausible on the face of it, but why wouldn't you store special characters and then ignore them when matching patterns? You could then make an exception for strings in quotes (or some other option for activating a more precise search). Maybe Google hasn't previously thought the extra space/complexity was worth the special treatment but given the relative quantity of data they already index an…

You need to double the size of the index. You now need an index with punctuation and without punctuation.

Previously if a document contained "(hello" it would just be stored in the index once: as "hello". With this change, it needs to be stored in the index twice, as "(hello" and "hello", so that people searching either term can find it.

Re: Improvements to searching for special characters in programming languages

#30
post #23

I am a bit sad that no Haskell results show up in this search: ">>= operator": https://www.google.com/#q=%3E%3E%3D+operator&* But it's a sight better than it was before. It actually shows meaningful programming language results. And if I call the operator by it's Haskell name at the same time, I get very good results: ">>= bind": https://www.google.com/#q=%3E%3E%3D+bind&* Or just the language name: ">>= Haskell": htt…

For your first search, I see "Operator Glossary - Haskell Lang" as the 9th result.

Ah, Google's personalization of searches. Here's what I see:

Operators in C++ - TutorialsPoint https://www.tutorialspoint.com/cplusplus/cpp_operators.htm

Operators in C++ - Learning C++ in simple and easy steps : A beginner's tutorial ... Right shift AND assignment operator, C >>= 2 is same as C = C >> 2. ‎C++ Loop Types · ‎Conditional operator · ‎C++ Pointer Operators · ‎Increment operator Assignment operators - JavaScript | MDN https://developer.mozilla.org › ... › JavaScript reference › Expressions and operators

Feb 3, 2017 - An assignment operator assigns a value to its left operand based on the value of its right operand. ... Right shift assignment, x >>= y, x = x >> y. Operators in C and C++ - Wikipedia https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B

This is a list of operators in the C and C++ programming languages. All the operators listed exist in C++; the fourth column "Included in C", states whether an ...

Right Shift Assignment Operator (>>=) - MSDN - Microsoft https://msdn.microsoft.com/en-us/library/y9h99e01(v=vs.100)....

Using this operator is almost the same as specifying result = result >> expression, except that result is only evaluated once. The >>= operator shifts the bits of ...

https://msdn.microsoft.com/en-us/library/ayt2kcfb.aspx

Jul 20, 2015 - except that x is only evaluated once. The C# Operators https://msdn.microsoft.com/en-us/library/6a71f45d.aspx

Jul 20, 2015 - x >>= y – right-shift assignment. Shift the value of x right by y places, store the result in x , and return the new value. => – lambda declaration. -= Operator (C# Reference)1 - MSDN - Microsoft https://msdn.microsoft.com/en-us/library/d31sybc9.aspx

Jul 20, 2015 - except that x is only evaluated once. The / operator is predefined for numeric types to perform division. The /= operator cannot be overloaded ...

What does this ">>=" operator mean in C? - Stack Overflow stackoverflow.com/questions/17769948/what-does-this-operator-mean-in-c

Jul 21, 2013 - unsigned long set; /set is after modified/ set >>= 1;. I found this in a ... The expression set >>= 1; means set = set >> 1; that is right shift bits of set ...

java - What does "|=" mean? (pipe equal operator) - Stack Overflow stackoverflow.com/questions/14295469/what-does-mean-pipe-equal-operator

Jan 12, 2013 - |= reads the same way as += . notification.defaults |= Notification.DEFAULT_SOUND; .... 2 >= Right shift AND assignment operator C >>= 2 is same as ...

C++ Operator Precedence - cppreference.com en.cppreference.com/w/cpp/language/operator_precedence

Oct 12, 2016 - Precedence, Operator, Description, Associativity. 1, :: Scope resolution ... For relational operators > and ≥ respectively. 9, == != For relational ...

Post reply on HN