|
| 1 | + |
| 2 | +# Exercises |
| 3 | + |
| 4 | +### Exercise 1: Track changes |
| 5 | + |
| 6 | +To track changes to their code over time, a programmer copies the entire source folder whenever they finish a piece of work. |
| 7 | +They rename the copy folder so that it contains the current date and copy it to their Google Drive. |
| 8 | + |
| 9 | +**Questions:** |
| 10 | + |
| 11 | +- What are disadvantages of this approach? |
| 12 | +- When would it definitely fail? |
| 13 | +- What is a better alternative? |
| 14 | + |
| 15 | +---- |
| 16 | + |
| 17 | +### Exercise 2: Debugging |
| 18 | + |
| 19 | +A programmer debugs a program by reading the code over and over whenever an error occurs. |
| 20 | +This takes a lot of time and sometimes they don't find the bug at all. |
| 21 | + |
| 22 | +**Enumerate as many alternative debugging strategies as possible** |
| 23 | + |
| 24 | +---- |
| 25 | + |
| 26 | +### Exercise 3: Testing |
| 27 | + |
| 28 | +A programmer is using a small data file to test their code. |
| 29 | +After changing the code, they run the entire program with the test file and inspect the output carefully. |
| 30 | +They are generally happy with their approach, and it helps them to remove lots of issues. |
| 31 | + |
| 32 | +**Questions:** |
| 33 | + |
| 34 | +- What kind of bugs would you find by testing the program this way? |
| 35 | +- What limitations does the approach have? |
| 36 | +- What is a complementary strategy to make sure the program is working? |
| 37 | + |
| 38 | +---- |
| 39 | + |
| 40 | +### Exercise 4: Versions |
| 41 | + |
| 42 | +Two programmers work together on the same program. Both of them use slightly different Python versions. |
| 43 | +After some time, they decide to install exactly the same Python version. |
| 44 | + |
| 45 | +**Questions:** |
| 46 | + |
| 47 | +- What do Python versions differ in? Find one example. |
| 48 | +- How could the programmers install exactly the same versions of Python libraries? |
| 49 | +- One of the programmers is working on another project that requires different library versions. Do they need to get another computer? |
0 commit comments