• Complex
  • Title
  • Keyword
  • Abstract
  • Scholars
  • Journal
  • ISSN
  • Conference
搜索

Author:

Mi, Qing (Mi, Qing.) | Bai, Haotian (Bai, Haotian.) | Wang, Xiaozhou (Wang, Xiaozhou.) | Liu, Wenrui (Liu, Wenrui.) | Song, Xingyue (Song, Xingyue.)

Indexed by:

EI Scopus

Abstract:

Stack Overflow (SO) is one of the world’s largest technical Q&A websites, in which many posts contain code snippets. However, these code snippets may not comply with coding style guidelines and result in the problem of low readability and maintainability. To provide a better understanding of this coding style compliance issue for SO users, we plan and conduct an empirical study on SO. Specifically, we collected over 400,000 code snippets from SO in three languages, namely Python, C/C++, and JavaScript. The posts are divided into two types (i.e., question and answer) and analyzed separately. We found that for the question- and answer-type posts, more than 90% and 60% of code snippets contain style violations. The most frequently found violation is syntax errors for Python and indentations for C/C++ and JavaScript. In addition, the results show that with more violations in code snippets, the 'Score' of Python and C/C++ posts, the 'FavoriteCount' of C/C++ questions, and the 'CommentCount' of JavaScript questions tend to be lower. The findings of our research indicate that code snippets on SO do not have good coding style compliance. Users, especially programming beginners are supposed to be wary of the potential problems of reusing code snippets on SO. © 2023 Knowledge Systems Institute Graduate School. All rights reserved.

Keyword:

Software engineering C++ (programming language) Python Knowledge engineering

Author Community:

  • [ 1 ] [Mi, Qing]Faculty of Information Technology, Beijing University of Technology, Beijing, China
  • [ 2 ] [Bai, Haotian]Faculty of Information Technology, Beijing University of Technology, Beijing, China
  • [ 3 ] [Wang, Xiaozhou]Faculty of Information Technology, Beijing University of Technology, Beijing, China
  • [ 4 ] [Liu, Wenrui]Faculty of Information Technology, Beijing University of Technology, Beijing, China
  • [ 5 ] [Song, Xingyue]Faculty of Information Technology, Beijing University of Technology, Beijing, China

Reprint Author's Address:

Email:

Show more details

Related Keywords:

Related Article:

Source :

ISSN: 2325-9000

Year: 2023

Volume: 2023-July

Page: 130-135

Language: English

Cited Count:

WoS CC Cited Count:

SCOPUS Cited Count:

ESI Highly Cited Papers on the List: 0 Unfold All

WanFang Cited Count:

Chinese Cited Count:

30 Days PV: 1

Affiliated Colleges:

Online/Total:676/5426836
Address:BJUT Library(100 Pingleyuan,Chaoyang District,Beijing 100124, China Post Code:100124) Contact Us:010-67392185
Copyright:BJUT Library Technical Support:Beijing Aegean Software Co., Ltd.