How often do you "Google" while programming?

14 points by zengr ↗ HN
Let's face it. We all google/search a lot while programming. I am a new programmer (from the last 2yrs) and I hate it, but when ever I am stuck, I search for quick solutions online.

What about you guys? How can this "problem" be solved? or...its ok?

20 comments

[ 2.7 ms ] story [ 51.9 ms ] thread
It is like reaching for a reference book albeit, perhaps one that is less edited. Reference books exist for a reason... to reference.
But, the old way of referencing is using an index, so I think I should go to javadocs and look for the method and not search for "how to do xyz+java"
That is a mighty limited concept of 'reference' you have. Reference books are books you refer to when you want to know how to do something. Build a deck, grow orchids, how to do xyz in java.
Why on Earth would you limit yourself to the old way of doing things? You're not recreating a war; you're trying to get stuff done.
But don't you jump to the right class javadocs via a well-tuned Google search?

(I've probably queried some variant of [java Pattern 5] hundreds of times to look up Java regex syntax. It's odd to see that the Sun Javadocs have now dropped from the rankings for this query with the Oracle re-domaining, and now some Columbian University mirror is the top hit.)

More than 10 years in (implies mastery, right?) I still search all the time. However, I'm not looking for solutions per se. Instead, I'm just looking to refresh myself on the available building blocks (whether it be the API or whatever syntactic sugar the particular language at hand provides). In exchange for this constant dependence on external technical reference, you can gain fluency in a large number of languages libraries and tools.

Learn the big, important concepts in a variety of domains, and don't ever worry about memorizing the finicky details (which might very well change in the next release anyway).

I've been programming since middle school and I'm now almost 30 and I google all the time. There's too much to remember, and I wouldn't want to burden my memory with too many specifics. I try to focus on remembering generic patterns, since those are far harder to search for.
It depends a lot on the experience/background of the person, as well as the problem at hand. Most programming "problems", like any other engineering field, have already been solved, so there's no shame in turning to a search engine or even better, StackExchange, for solutions. The best coders are the ones that are learning all the time.

On the other hand, there is usually an impedance mismatch between the description of the problem and the actual solution. Take a look at the horror stories on The Daily WTF. http://thedailywtf.com/

Anyway, try to read as much code as possible, both good and bad, find a mentor(s), be able to take constructive criticism, and just persevere, and you should be fine.

I find searching is the fastest way to find documentation for library functionality as well as example code for when the documentation didn't cut it. I don't see why you should hate it. I did a fair bit of Win32 stuff a while back, and still poke around the occasional bit of Windows driver code when trying to make weird/outdated stuff work. The documentation on those is terrible. Searching is the only way. I mostly write Python now, but I still find I rather search modulename+functionname than use help().
My search history page says ~70 queries/day on work days and ~30 on weekends - majority of that stuff is about programming. So yeah it's not a problem.

That said - I don't even bother remembering the links to documentation. When I need something I just go to "python docs multiprocessing" or similar address and hope that I'm lucky. Search is the new URL ;)

Same here, but that might not be the best example since there is `pydoc multiprocessing`, perhaps integrated with your editor.
I remember only 5 years a gruffy old sysadmin preaching "Can't you guys code without googling all the time? Programming is not what it used to be." I listened to his advice for a while & I'm thankful for it. I now try to do big conceptual work in offline mode but google like crazy for all the nitty-gritty details.
I google all the time at work. Hell, I google all the time at home and 90% of the time it's about programming in some way or form.

I think Google is one of the greatest and most useful tools in my very meager toolbox.

yep if i want deeper explanation of funcations and their uses mainly, probably 20 times a day i would say if im just crusing, if im speeding 50-60 times a day,
Technology changes fast. So fast, that now days the most effective strategy is not to know everything, but to know how to find relevant docs efficiently. Of course you also need basic skills for understanding and using them properly.. Now that, comes from experience.
$needle, $haystack

or

$haystack, $needle

I google this nearly every time I use a PHP function.
I can't remember off the top of my head but it should be ($needle, $haystack) if it isn't because of the appearance order in the English colloquialism "NEEDLE in the HAYSTACK".
Its perfectly ok. A lot of times others have already ran into the particular problem and already solved it. You need to understand the solution, just don't blindly accept some random solution found on the internet. If you do this, then your code will get ugly fast and you will not know what it is doing. But there is nothing wrong with finding a solution, studying it, understanding it, and then using it in your own code.
I'm always googling something while programming although this question has me wondering what I'd do if I were still on a dial up connection! {{shudder the thought}}