Robot programming learning is an effective approach to developing 21st century learning skills. However, there are many problems in the learning practice of robot programming. Recently, teaching based on virtual reality (VR) has appeared as an effective method of robot programming teaching. Therefore, the current study examines the application of VR affordances in robot programming and provides a design of the learning module based on VR. The whole module is presented in 3 parts: needs assessment, media selection, and learning activities. The needs assessment part illustrates the needs, targeted learners, and learning objectives. The second part discusses and concludes why VR is suitable for robot programming learning and how it takes effect in the learning process. Ultimately, this third part provides the learning activities based on the discussion above. The learning activities are divided into 3 parts: robot lab, task classroom, and competitions. Each part takes advantage of specific affordances. These designs are aimed at facilitating learners’ collaboration and construction. The theory of change is also analyzed in the conclusion. In addition to the content of learning objectives, better collaboration and construction are expected to be the learning outcomes.