Teaching programming in elementary schools is becoming popular nowadays so that students can acquire logical thinking and programming abilities as 21st century skills. However, it remains unclear what students actually learn when they engage in programming. In this study, I describe student learning in the two types of programming workshops that I conducted at an elementary school in Japan, referring to half a century of research history on using programming as a way to learn how to learn.