Feb 01, 2019 16:21:37

Coding is knowing how to ask questions *well*

by @jasonleow | 641 words | 110🔥 | 110💌

Jason Leow

Current day streak: 110🔥
Total posts: 110💌
Total words: 47367 (189 pages 📄)

I'd been taking a web development course on Udemy and this week I finally started on learning server-side programming. Front-end development had been relatively easier for me to pick up because over the years of setting up Wordpress websites, one invariably comes across HTML, CSS and some Javascript. I realised there had been a lot of accidental immersion and learning in that aspect. But, back-end is completely foreign to me and now it's feeling really hard.


One of the main things I never learned though was how to properly google programming questions when I'm stuck. As a beginner, I'm completely unfamiliar with the technical terms of the language, so I end up searching using very broad, vague keywords that doesn't help much at all. I don't even know how to phrase my problem properly!


For instance, I was learning how to make a web scraper using PHP. The instructor showed us how to use file_get_contents function but just to get the whole web page. I wanted to scrape a specific text content from a specific class so just simply using file_get_contents wouldn't work . So I simply googled "PHP scrape html class element". Some useful stuff but still kind of broad. A lot of stuff pointing me to using other libraries. I fiddled around, copy and pasted bits of code I found from Stack Overflow but nothing worked (I later realised I needed to download the libraries, which wasn't really mentioned in the answers 😭). Later on during the instructor demo, he googled "split a string" and got links to the explode function, which helps to extract specific parts of the HTML code after you used the get_file_contents function. Like WTF? How does a beginner even know "split a string" are the right keywords to use?


The problem is I don't even know the right words to use to get to what I need. The right words at the right level of specificity and technicality. Learning the coding 'vocabulary' of terms and syntax takes time and as a beginner, that's my weak spot in being able to find the right answers online.


It felt like I was trying to learn a foreign language, like say French, but only had a German-French dictionary to learn it. If I don't know German to start with, how do I even find the right word in French? How do I bridge English to German (i.e. rookie search keywords to right technical terms to the right answer)?


After doing some reading online and coming across great articles like this one, I learned that it's like a funnel/spiral, with at least 2 layers of search to slowly zoom in on my answer:


1.  Do a general, intentionally imperfect search first, to find the right technical terms:

a.  Search on community forums where beginners might have phrased the same question in the same way as you would have. Stack Overflow might not be the most useful at this stage yet.

b.  Or scroll through support documentation like W3 School or specific ones like PHP.net (these are like the 'dictionaries' of programming), where you can read through the definitions of the syntax, and starting collecting the right keywords...

c.  Narrow in on a few keywords - the language/framework/library you're using, a noun to describe the what (e.g. element, selector), a verb to describe an action/task you want to do with something (e.g. event, function)


2. Then get more specific and technical on the next layer of search:

a.  This time, we can start trying more expert forums like Stack Overflow, or one for your language

b.  Type <language> <element> <function> and search away! 


Did I miss out anything? Any other useful tips on how to google for the right answer in programming?

From Jason Leow's collection:

  • 1

    @jasonleow Nice post, this will be very helpful for me.

    I am also in the same situation. Always gets frustrated by not getting the exact answer in one search but the instructor will just do a single search and get to the point. It's not fair.

    Navin avatar Navin | Feb 01, 2019 20:46:38
    • 1

      @navinnavi hahaha so true! My instructor does the same. Unfair!

      Jason Leow avatar Jason Leow | Feb 02, 2019 10:38:53
  • 1

    @jasonleow interesting post on asking the right questions to google. I totally agreed that it would take to become really good at it.

    plus 1 on the general to specific.

    * Define what your problem is in plain language, then try to convert it into a technical.

    * Sometimes I copy paste the whole error in google ( it works sometimes on what is the problem when your code doesn't work as expected.

    * Adding Programming language on your questions helps to narrow down the query like 'How to -split words in PHP/ Javascript"

    * Familiarized yourself in some technical jargons/functions like splits, truncate, parse, decode, encode, syntax.

    * Be patience when you are searching just enjoy the process of exploring the solutions.

    Christopher Deuda avatar Christopher Deuda | Feb 01, 2019 16:55:20
    • 1

      @christopherdeuda thanks for the tips! +1 on copy paste the error in google because i often forget about that one. Trying to enjoy the process but it's also frustrating at same time haha...love/hate relationship

      Jason Leow avatar Jason Leow | Feb 01, 2019 17:14:22
    • 1

      @jasonleow Welcome =). On enjoying the process I have frustrations as well before when I couldn't find the solutions. Then I try to shift my mind that it's not really personal and I could always try the next day if I didn't solve it today.

      Christopher Deuda avatar Christopher Deuda | Feb 01, 2019 17:39:16
contact: email - twitter - facebook