• Home
  • Search
  • Python Coding Style Compliance on Stack Overflow
  • Open Access IconOpen Access
  • Cite Icon27
  • https://doi.org/10.1109/msr.2019.00042Copy DOI Icon

Python Coding Style Compliance on Stack Overflow

  • May 1, 2019
  • Nikolaos Bafatakis +6 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Software developers all over the world use Stack Overflow (SO) to interact and exchange code snippets. Research also uses SO to harvest code snippets for use with recommendation systems. However, previous work has shown that code on SO may have quality issues, such as security or license problems. We analyse Python code on SO to determine its coding style compliance. From 1,962,535 code snippets tagged with 'python', we extracted 407,097 snippets of at least 6 statements of Python code. Surprisingly, 93.87% of the extracted snippets contain style violations, with an average of 0.7 violations per statement and a huge number of snippets with a considerably higher ratio. Researchers and developers should, therefore, be aware that code snippets on SO may not representative of good coding style. Furthermore, while user reputation seems to be unrelated to coding style compliance, for posts with vote scores in the range between -10 and 20, we found a strong correlation (r = -0.87, p <; 10^-7) between the vote score a post received and the average number of violations per statement for snippets in such posts.

Similar Papers
  • Conference Article
  • Citations17

ICSD

  • Dec 03, 2018
  • Yanfang Ye +7
  • Research Article

Broken external links on Stack Overflow

  • Oct 10, 2020
  • arXiv (Cornell University)
  • Jiakun Liu +6
  • Conference Article
  • Citations7

Characterizing Duplicate Code Snippets between Stack Overflow and Tutorials

  • May 01, 2019
  • Manziba Akanda Nishi +2
  • Conference Article
  • Citations63

Relationship-aware code search for JavaScript frameworks

  • Nov 01, 2016
  • Xuan Li +5
  • PDF
  • Research Article
  • Citations1

SCC-GPT: Source Code Classification Based on Generative Pre-Trained Transformers

  • Jul 07, 2024
  • Mathematics
  • Mohammad D Alahmadi +2
  • Conference Article
  • Citations18

A Qualitative Investigation of Insecure Code Propagation from Online Forums

  • Sep 01, 2019
  • Wei Bai +2
  • PDF
  • Research Article
  • Citations11

Incorporating Code Structure and Quality in Deep Code Search

  • Feb 16, 2022
  • Applied Sciences
  • Hao Yu +3
  • Conference Article

Detecting Adversarial Prompted AI-Generated Code on Stack Overflow: A Benchmark Dataset and an Enhanced Detection Approach

  • Sep 07, 2025
  • Aman Swaraj +3
  • Research Article
  • Citations1

How Do OSS Developers Reuse Architectural Solutions From Q&amp;A Sites: An Empirical Study

  • Jul 01, 2025
  • IEEE Transactions on Software Engineering
  • Musengamana Jean De Dieu +2
  • Research Article
  • Citations29

Post2Vec: Learning Distributed Representations of Stack Overflow Posts

  • Sep 01, 2022
  • IEEE Transactions on Software Engineering
  • Bowen Xu +5
  • Conference Article
  • Citations1

How Fast and Effectively Can Code Change History Enrich Stack Overflow?

  • Dec 01, 2020
  • Ryujiro Nishinaka +3
  • Conference Article
  • Citations274

You Get Where You're Looking for: The Impact of Information Sources on Code Security

  • May 01, 2016
  • Yasemin Acar +5
  • Conference Article
  • Citations13

Employing source code information to improve question-answering in stack overflow

  • May 16, 2015
  • Themistoklis Diamantopoulos +1
  • Book Chapter
  • Citations3

Exploring the Feature Selection-Based Data Analytics Solutions for Text Mining Online Communities by Investigating the Influential Factors: A Case Study of Programming CQA in Stack Overflow

  • Jan 01, 2016
  • Shu Zhou +1
  • Dissertation
  • Citations5

Towards understanding the challenges faced by machine learning software developers and enabling automated solutions

  • Sep 04, 2020
  • Md Johirul Islam
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.