On the usage of pythonic idioms

Developers discuss software architecture and concrete source code implementations on a regular basis, be it on question-answering sites, online chats, mailing lists or face to face. In many cases, there is more than one way of solving a programming task. Which way is best may be decided based on case-specific circumstances and constraints, but also based on convention. Having strong conventions, and a common vocabulary to express them, simplifies communication and strengthens common understanding of software development problems and their solutions. While many programming ecosystems have a common vocabulary, Python's relationship to conventions and common language is a particularly pronounced. The "Zen of Python", a famous set of high-level coding conventions authored by Tim Peters, states "There should be one, and preferably only one, obvious way to do it". This 'one way to do it' is often referred to as the 'Pythonic' way: the ideal solution to a particular problem. Few other programming languages have coined a unique term to label the quality of craftsmanship gone into a software artifact. In this paper, we explore how Python developers understand the term 'Pythonic' by means of structured interviews, build a catalogue of 'pythonic idioms' gathered from literature, and conjecture on the effects of having a language-specific term for quality code, considering the potential it could hold for other programming languages and ecosystems. We find that while the term means different things to novice versus experienced Python developers, it encompasses not only concrete implementation, but a way of thinking — a culture — in general.

[1]  Michal Jaworski,et al.  Expert Python Programming , 2008 .

[2]  Mark Lutz Programming Python - Powerful Object-Oriented Programming: Covers Python 3.x (4. ed.) , 2011 .

[3]  Brett Slatkin,et al.  Effective Python: 59 Specific Ways to Write Better Python , 2015 .

[4]  R. Paige,et al.  Culture Learning in Language Education: A Review of the Literature. , 2000 .

[5]  Chandrasekar Subramaniam,et al.  Determinants of open source software project success: A longitudinal study , 2009, Decis. Support Syst..

[6]  Thomas Fritz,et al.  Sensing Interruptibility in the Office: A Field Study on the Use of Biometric and Computer Interaction Sensors , 2018, CHI.

[7]  Eleni Stroulia,et al.  Code convention adherence in evolving software , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

[8]  James Harland,et al.  Evaluating the dynamic behaviour of Python applications , 2009, ACSC.

[9]  Barbara Ericson,et al.  Introduction to Computing and Programming in Python - a Multimedia Approach, 4th Edition , 2016 .

[10]  Joseph Gil,et al.  Design Patterns vs. Language Design , 1997, ECOOP Workshops.

[11]  Marco Aurélio Gerosa,et al.  A systematic literature review on the barriers faced by newcomers to open source software projects , 2015, Inf. Softw. Technol..

[12]  David Ascher,et al.  Python Cookbook , 2002 .

[13]  Winston M. Tellis,et al.  APPLICATION OF A CASE STUDY METHODOLOGY , 1997 .

[14]  Mari Rege,et al.  Why do people care about social status , 2008 .

[15]  Michal Jaworski,et al.  Expert Python Programming - Second Edition , 2016 .

[16]  Sushil Krishna Bajracharya,et al.  Sourcerer: a search engine for open source code supporting structure-based search , 2006, OOPSLA '06.

[17]  Spencer Rugaber,et al.  Programming with idioms in APL , 1979, APL '79.

[18]  David Ascher,et al.  Python cookbook, second edition , 2005 .

[19]  Charles A. Sutton,et al.  Learning natural coding conventions , 2014, SIGSOFT FSE.

[20]  Miguel P Caldas,et al.  Research design: qualitative, quantitative, and mixed methods approaches , 2003 .

[21]  Jose Dieguez Castro Introducing Linux Distros , 2016, Apress.

[22]  Shane McKee,et al.  Software Practitioner Perspectives on Merge Conflicts and Resolutions , 2017, 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[23]  Chih-Pei Hu,et al.  John W. Creswell, Research Design: Qualitative, Quantitative, and Mixed Methods Approaches , 2017 .

[24]  Paul Barry Head First Python - a Brain-Friendly Guide , 2011 .

[25]  Brad Abrams,et al.  Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries , 2005 .

[26]  Christoph Treude,et al.  Overcoming Open Source Project Entry Barriers with a Portal for Newcomers , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[27]  Alberto Bacchelli,et al.  Expectations, outcomes, and challenges of modern code review , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[28]  Jing Li,et al.  The Qualitas Corpus: A Curated Collection of Java Code for Empirical Studies , 2010, 2010 Asia Pacific Software Engineering Conference.

[29]  Java design patterns: a tutorial , 2000 .

[30]  D. Block,et al.  Language and Social Class , 2020, The International Encyclopedia of Linguistic Anthropology.

[31]  Harald C. Gall,et al.  Redundancy-free analysis of multi-revision software artifacts , 2018, Empirical Software Engineering.

[32]  B. Uzzi,et al.  The Sources and Consequences of Embeddedness for the Economic Performance of Organizations: The Network Effect , 1996 .

[33]  Daniela E. Damian,et al.  Selecting Empirical Methods for Software Engineering Research , 2008, Guide to Advanced Empirical Software Engineering.

[34]  Ewan D. Tempero,et al.  Understanding the shape of Java software , 2006, OOPSLA '06.

[35]  Mark Grand Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML , 2002 .

[36]  Mark Pilgrim,et al.  Dive Into Python , 2004, Apress.

[37]  J. Burton Browning,et al.  Pro Python , 2014, Apress.