3 ms·
Ask HN: What are your strategies to find answers on your programming questions?
I am a TA -- from time to time -- where I help teaching introductory programming classes. What I noticed is that half of the students don't know how to use a search engine effectively. Normally I wouldn't think much of this and just help them how to reason on how to use a search engine effectively. But today I noticed that I've never structured these thoughts. So I was wondering if you could help me with that.
My question: what strategies do you use to find relevant content about programming when you're stuck, or when you need to wrap your head around a concept?
I have three strategies:
1) Use Google: type in the technical terms that you know, in order to formulate your question and search. I find it hard to explain how this process works in my mind.
2) Use the suggestion engine of Stackoverflow: click on `Ask Question`. Type the title of your question and type your actual question. Instead of submitting the question, click on the links in the suggestion engine. Your answer is usually there. I resort to this when Google doesn't work.
3) Use the search engine of Hacker News: type in the topic that you want to learn more about and look for the most upvoted tutorial. It's very likely to be quality material. And if it isn't quality material, then read the comments, suggestions are offered there.
Final note:
There's probably a good YouTube/online video strategy as well, but I wouldn't know it. Also, the strategies could use more elaboration, especially the first one.
- cocktailpeanuts 10y agoTo refine (1), you could try site:stackoverflow.com option because there are so many copypaste sites out there. This has been especially helpful for me when I'm searching for an open source library. I use the site:github.com along with the keyword, it's 100 times better than searching on github.
- mettamage 10y agoThat's an awesome tip. You reminded me of a 4th strategy that is emerging within my realm of strategies. Which is: go to Github.com, search on the topic of interest, sort on most popular projects and check them out. This helps mainly with finding tools that are "best practices." It's a bit more hairy than the other strategies though and I'd combine this with searching on HN and Google, but I've noticed it works pretty well as a heuristic.
- cocktailpeanuts 10y agoThat's what I used to do, but i realized that github search is terrible for some reason. They don't display all results, so I would think that I've found the most popular library for X, just to find out later that it's not, and there's a completely different one that didn't show up on Github search. That's why I don't trust github search anymore and use the site:github.com approach.
- mettamage 10y agoHmm, using search engine X to search on website Y. That's an interesting tactic to keep in mind.
- roryisok 10y agoThis, definitely. Very useful. You can also search within stack overflow and limit your results by a certain tag, like this writing to a file [winjs] This will search for all matches which are tagged with "winjs". very good for targeting your search to a platform. edit: thats a tip for stackoverflow's internal search. not to be combined with site:stackoverflow.com in google. I don't think that would work
- roryisok 10y agoUse DuckDuckGo.com as your main search engine. They dig up the first accepted answer to the first matching question on stackoverflow and present it at the top of the search results http://imgur.com/a/qwXEV http://imgur.com/a/qwXEV It saves a lot of time for simple questions
- mettamage 10y agoI tried it for a couple of queries. 1. node.js express 3 vs express 4: doesn't fully work, SO is at #3. 2. node start server: wrong answer, wasn't looking for it. 3. node js start server: outdated answer, right answer though! Note: it's just a nitpick though, because using DuckDuckGo.com might give the right answer immediately and if it's just as good as Google (wouldn't know, am willing to find out), then this feature may actually help in some cases.
- roryisok 10y agoI agree it's not perfect, but it does save time for me daily. Also they claim not to track user activity at all, which is nice if you don't like google's record on privacy
- mettamage 10y agoI found there's also http://symbolhound.com/ http://symbolhound.com/ It allows you to type special symbols in the search engine.
- DanBC 10y agoSo far everyone has spoken about what to do when you know what you're looking for. But beginners don't necessarily know what they're looking for. They want a function that does some thing. They have no idea what that function is called, and they don't know how that function is described, so all their search terms miss what they're looking for.
- mettamage 10y agoGood point, I invented a word for this just so I can diagnose this problem quicker for myself. I call it a "search term scavenger hunt" (the Dutch version feels more like a real word: zoekwoordspeurtocht). It's that moment where you realize that your search terms are way off and you need to find the right search terms first.
- brudgers 10y agoTyping technical terms into google and forming the right questions on StackOverflow work for people with expertise. A beginner may not have the right term, they might type 'map' or 'hash' or 'hashmap' or 'hashtable' when wondering about Python. Beginners also aren't in a position to evaluate results. Suppose a beginner manages to type 'Python dictionary'. The top result I get is the Python 3.5.2 documentation and at the top of the page it says 'Data Structures' and underneath it says 'Lists' and to make matters worse, maybe my project is in Python 2 and so I don't have the framework to decide if I'm on the right page and making a mistake means I get a bad grade and I'm under a drop dead deadline and so I really don't want to make a mistake. Ok, so here's my random internet advice: forget about what you would do and measure what your students are doing and determine which of those strategies are better and worse and then start teaching from there. Point out things that students might try intuitively that tend to be ineffective and provide examples of other strategies students use that tend to be more effective and explain why they are. Ultimately, effective searching is effective because the person making the query has built up an effective mental model over how search works. Good luck.
- BjoernKW 10y agoPretty much like the ones you're describing. What I find extremely valuable is to Google search for specific stack trace error messages as search phrases. Just as some other commenters said this requires experience. I sometimes jokingly say that I'm not a good programmer I just know how to use Google and Stack Overflow very effectively. In order to be able to do so you have to be able to ask the right questions though (e.g. not just pasting "NullPointerException" into the search box but the specific line in a 3rd party library this exception occurs in).
- Jugurtha 10y ago"The beginning of wisdom is to call things by their proper name." - Confucius. "The only difference(!) between Shakespeare and you was the size of his idiom list - not the size of his vocabulary." - Alan Perlis. The problem in the beginning is not knowing what I don't know. I have the concept in my mind, but I can't map it to discipline terms. One solution for this is to shed light on the unknown by exposing the known to people. A sort of impulse response characterization. An example would be, for an unknown function, to give the function's input and the desired output.. and ask people what sort of thing can do that and what is it called. The more experienced will recognize what the person is trying to do and give options. It also can mean, for a known function, giving the input, the output, and what we expected the output to be. For example, I began learning Python and I think this was the first question I asked on the mailing list ('Why is an instance smaller than the sum of its components?') because the behavior was odd to me: https://mail.python.org/pipermail/tutor/2015-February/104098.html https://mail.python.org/pipermail/tutor/2015-February/104098... A few methods that served me well: - Having toy projects I'm playing with: This ensures I have problems beyond my skill level, and prompts me to think about solutions. Ugly solutions that make me say "Can't believe I'm writing this". This is a signal that I know that what I'm doing is wrong and I don't know the right way to do it yet. What I know is this can't be right. Get code reviews: https://mail.python.org/pipermail/tutor/2015-April/105199.html https://mail.python.org/pipermail/tutor/2015-April/105199.ht... Mistakes are for programming proficiency what muscle fiber tears are for muscle growth. Not making mistakes rarely if ever means writing perfect code and almost always means no growth. I wish I've had tons of side projects for this is what makes people good. I dearly regret this. - Roaming through documentation. - Always thinking "meta": I have a running process looking at design and simplicity in general and a canonical way to approach writing well. This is interdisciplinary and would get you flagged on Stack Overflow. Yet, I find this of paramount importance. I remember struggling, frustrated, thinking "If there's clearly good code design, and bad code design.. It means there's a universal "thing" code can either fail or succeed at abiding by.. A sort of pattern good code follows and bad code violates. Similar to what Blaise Pascal said about beauty.. What is this thing called? What are the rules that all good programmers know but are somehow impervious to me?" When I found out there was such a thing called "design patterns", I smiled in a "of course there is" because my formulation of the problem contained both words. Why didn't I simply look for that expression.. (I was looking for good software practices, good taste, etc). But having side projects is the most important. I'm both blessed and cursed for I started programming at 9 and by 15 I was "improving already compiled software" and in that period, I was exposed to BASIC (GWBASIC, QBASIC, Visual Basic for DOS and Windows), x86 Assembly, C, Pascal/Delphi, C++, so this makes it slightly easier.... The curse is that I haven't used that edge keeping at it so I haven't become good (I didn't have internet, English is my fifth language and there was no one to talk with about this stuff where I live. It was solitary and isolated). I think it would be great to try to design something in a team, like think of a real product and get the whole class to work on delivering it. I think having a go at making software as it would be made in the real world is one of the best exercises to get good at ... well, making software as they will make it in the real world. Runners run and deal with sprained ankles, golfers golf and deal with winds, swimmers swim and deal with water in their nose, but somehow coders do fizzbuzz. I think a curriculum that offers a taste of the real world would do more good than harm.