General tips

This chapter will teach you some useful tricks that all computer science students should know.

When you don't know how to program something

The first thing to do is search for it on Google, Duckduckgo or similar web search sites.

Writing good searches

This may seem like a joke but a good estimate would be that over half of all new students have issues finding answers online. It is easy to get low-quality results but you can take a few steps to ensure that you get mostly good-quality results.

Before we begin, keep in mind that you will get much better results if you search in English, compared to any other language.

First, we have to decide what we want to know. As an example, suppose we would like to know how to reverse a list in python. Good searches are usually in the form <what you want> <language or program you want to use>. So for our example, we might search for How to reverse a list in python. This is more verbose than it has to be and reverse list python works just as well.

If possible, search directly on sites that are known to have good results. For example, Stackoverflow is a place where developers can ask questions and everybody can answer, think of it as Wikipedia but for questions related to programming. While the answers are curated by experienced programmers you still have to be skeptical and understand that most programming answers are good enough rather than strictly correct and you will most likely have to adapt the solution to your specific problem. This might sound like a joke, but for certain applications, especially when troubleshooting or configuring programs, reddit is a very good source of information.

Finding good search results

There are countless sites offering programming advice. Avoid sites that look like news articles or have short sentences. These are usually either computer-generated or written to rate high up on search results. If possible try and find the official documentation. Remember that you can use !kbd[!ctrl+f] to find content on the page. This is more a problem than ever with AI generated slop articles showing up as a first result very often. These aren't always worthless but can often contain incorrect or misleading information.

If in doubt, and you can't find anything helpful for your language, search for documentation specifically, it can be tricky to read and understand at times but it can be incredibly useful.

Official or high-quality sources

  • Stackoverflow (and other sister-sites)
  • Hoogle, search haskell functions
  • MDN, web technologies such as HTML, CSS, Javascript