Developers often search for reusable code snippets on general-purpose web search engines like Google, Yahoo! or Microsoft Bing. But some of these code snippets may have poor quality in terms of readability or understandability. In this paper, we propose an empirical analysis to analyze the readability and understandability score from snippets extracted from the web using three independent variables: ranking, general-purpose web search engine, and recommended site. We collected the top-5 recommended sites and their respective code snippet recommendations using Google, Yahoo!, and Bing for 9,480 queries, and evaluate their readability and understandability scores. We found that some recommended sites have significantly better readability and understandability scores than others. The better-ranked code snippet is not necessarily more readable or understandable than a lower-ranked code snippet for all general-purpose web search engines. Moreover, considering the readability score, Google has better-ranked code snippets compared to Yahoo! or Microsoft Bing
翻译:开发者经常在谷歌、 Yahoo! 或 Microsoft Bing 等通用网络搜索引擎上搜索可重复使用的代码片断。 但其中一些代码片段在可读性或可理解性方面的质量可能很差。 在本文中,我们提议进行实证分析,分析从网上提取的可读性和可理解性分数,使用三个独立变量:排名、通用网络搜索引擎和建议网站。我们用谷歌 Yahoo! 和 Bing 收集了前5级推荐网站及其各自的代码片断建议, 使用谷歌收集了9, 480个查询, 并评价了它们的可读性和可读性分数。 我们发现, 某些推荐网站的可读性或可读性分数大大优于其它网站。 排序较好的代码片段不一定比所有通用网络搜索引擎的低级代码片断更易读或易懂性。 此外,考虑到可读性分数, 谷歌比雅虎 或微软冰 Bing 的代码片段排列得更好!