This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 2: What is programming?

It's all about instructing the computer!

face Josiah Wang

Summary:

  • Programming \ne coding
  • Programming \supset coding
  • Programming involves:
    1. Understanding and formulating the problem
    2. Designing an algorithm to solve the problem
    3. Implementing the algorithm
  • Machine code is what the computer understands, but us writing machine code will be tedious.
  • High-level languages have been developed to help make programming easier.
  • Translators convert high-level languages to low-level code:
    1. Compilers pre-translate codes into a set of low-level instructions, which is then executed.
    2. Interpreters translate and execute code line by line, on the fly.
  • Programming languages need to be unambiguous.
  • Spend more time thinking about the problem and developing a clear algorithm before coding.