An Exploratory Study on the Predominant Programming Paradigms in Python Code
Robert Dyer, Jigyasa Chauhan

TL;DR
This study classifies Python code into paradigms, revealing a predominant use of object-oriented features and their correlation with project size, based on analysis of over 100,000 open-source projects.
Contribution
It introduces an automated technique to classify Python files by paradigm and provides the first large-scale analysis of paradigm usage in Python projects.
Findings
Python developers favor object-oriented features.
Positive correlation between OO and procedural paradigms and project size.
Functional features are used despite few files being predominantly functional.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
