Physical computing is about programming and interacting with a tangible object to learn fundamental concepts of Computer Science (CS). This approach presents several benefits regarding motivation, creativity, and learning gains. Yet, these learning gains hardly are compared with those resulting from the programming of a simulation of a tangible object. In this article we present the results of a comparative study that has been conducted to explore this issue. With this study, we aimed to determine whether the programming of a tangible object or its digital simulation yields significantly different learning gains. In the experiment we conducted, participants (aged 14-17 with little or no prior programming knowledge) were dividing into two groups: one programmed a tangible electronic board (the BBC micro:bit) while the other programmed a simulation of it. The results of this experiment suggest that, while each group significantly improved their understandings of fundamental CS concepts (i.e., variables, conditions, and loops), no significant difference was found when comparing the learning gains between the two groups.