kirancodes.me
To Proof Maintenance & Beyond!

An exploratory study on the predominant programming paradigms in Python code

Robert Dyer, Jigyasa Chauhan

Abstract

Python is a multi-paradigm programming language that fully supports object-oriented (OO) programming. The language allows writing code in a non-procedural imperative manner, using procedures, using classes, or in a functional style. To date, no one has studied what paradigm(s), if any, are predominant in Python code and projects. In this work, we first define a technique to classify Python files into predominant paradigm(s). We then automate our approach and evaluate it against human judgements, showing over 80% agreement. We then analyze over 100k open-source Python projects, automatically classifying each source file and investigating the paradigm distributions. The results indicate Python developers tend to heavily favor OO features. We also observed a positive correlation between OO and procedural paradigms and the size of the project. And despite few files or projects being predominantly functional, we still found many functional feature uses.

BibTeX
@inproceedings{Dyer-Chauhan:FSE22,
  author    = {Robert Dyer and
               Jigyasa Chauhan},
  title     = {An exploratory study on the predominant programming paradigms in Python code},
  booktitle = {{ESEC/SIGSOFT} {FSE}},
  pages     = {684--695},
  publisher = {{ACM}},
  year      = {2022},
}

Related papers