What makes a good code example?: A study of programming Q&A in StackOverflow

Seyed Mehdi Nasehi, Jonathan Sillito, Frank Maurer, Chris Burns
2012 2012 28th IEEE International Conference on Software Maintenance (ICSM)  
Programmers learning how to use an API or a programming language often rely on code examples to support their learning activities. However, what makes for an effective code example remains an open question. Finding the characteristics of the effective examples is essential in improving the appropriateness of these learning aids. To help answer this question we have conducted a qualitative analysis of the questions and answers posted to a programming Q&A web site called StackOverflow. On
more » ... rflow answers can be voted on, indicating which answers were found helpful by users of the site. By analyzing these well-received answers we identified characteristics of effective examples. We found that the explanations accompanying examples are as important as the examples themselves. Our findings have implications for the way the API documentation and example set should be developed and evolved as well as the design of the tools assisting the development of these materials.
doi:10.1109/icsm.2012.6405249 dblp:conf/icsm/NasehiSMB12 fatcat:7u7iqmrl4rfy5pdrxde4u2dk7u