Bitpath

Boss lesson · Unit 03

The bug that hides

Halve the suspects: in the code, the input and the history

13 exercisesabout 3 min

What you practise

  • Binary search for a bug: in the input, in the code path with prints or a debugger, in history
  • Rubber-ducking
  • Off-by-one, mutation and aliasing bugs traced end to end

Try a question from this lesson

Pick one

One step of an 8-step pipeline is broken: right input, wrong output. A print after any step shows if the data is still right. How many prints always find the step?

Hint

Print in the middle first. How many suspects are left after that?

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Bisect everything

Debugging is a search. If you know one state that is good and one that is bad, check the middle, and half the suspects are gone.

It works on the code path: print halfway. It works on the input: delete half. It works on history: test the version halfway between the last good one and the first bad one.

11 more exercises in the app

  • 3× type the answer
  • 5× multiple choice
  • 1× fill the blanks
  • 1× order the lines
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy