Two halves of the same coin. Programming something is 'teaching' a computer to do it. Except a computer is in many ways the dumbest student possible; you have to spell everything out for it.
In other ways it's also the smartest student possible: It never forgets or misunderstands what you tell it (unless you instruct it to forget something, or you don't say what you actually mean.)
Taking something apart can also work for this. But it might require that you're the sort of person who is able to put it back together again afterwards.