Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 2 KB

exercises.md

File metadata and controls

60 lines (37 loc) · 2 KB

Exercises

Exercise 1: Track changes

To track changes to their code over time, a programmer copies the entire source folder whenever they finish a piece of work. They rename the copy folder so that it contains the current date and copy it to their Google Drive.

Questions:

  • What are disadvantages of this approach?
  • When would it definitely fail?
  • What is a better alternative?

Exercise 2: Debugging

A programmer debugs a program by reading the code over and over whenever an error occurs. This takes a lot of time and sometimes they don't find the bug at all.

Enumerate as many alternative debugging strategies as possible


Exercise 3: Testing

A programmer is using a small data file to test their code. After changing the code, they run the entire program with the test file and inspect the output carefully. They are generally happy with their approach, and it helps them to remove lots of issues.

Questions:

  • What kind of bugs would you find by testing the program this way?
  • What limitations does the approach have?
  • What is a complementary strategy to make sure the program is working?

Exercise 4: Versions

Two programmers work together on the same program. Both of them use slightly different Python versions. After some time, they decide to install exactly the same Python version.

Questions:

  • What do Python versions differ in? Find one example.
  • How could the programmers install exactly the same versions of Python libraries?
  • One of the programmers is working on another project that requires different library versions. Do they need to get another computer?

Exercise 5: Programming Skills

Discuss the following questions in a small group:

  • How would you assume that the velocity of runners distributed across a population? (If you want a statistical answer, check the Central Limit Theorem)
  • Enumerate a few activities that programmers need to do
  • Which of these activities do you enjoy in particular?
  • Which do you find difficult?