Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3276954.3276960acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

On the usage of pythonic idioms

Published: 24 October 2018 Publication History

Abstract

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.

References

[1]
Marty Alchin. 2010. Pro Python. Apress.
[2]
Carol V. Alexandru, Sebastiano Panichella, Sebastian Proksch, and Harald C. Gall. 2018. Redundancy-free analysis of multirevision software artifacts. Empirical Software Engineering (05 Jul 2018).
[3]
Miltiadis Allamanis, Earl T. Barr, Christian Bird, and Charles Sutton. 2014. Learning Natural Coding Conventions. In International Symposium on Foundations of Software Engineering.
[4]
Alberto Bacchelli and Christian Bird. 2013. Expectations, outcomes, and challenges of modern code review. In 35th International Conference on Software Engineering, ICSE 2013. 712-721.
[5]
Sushil Bajracharya, Trung Ngo, Erik Linstead, Yimeng Dou, Paul Rigor, Pierre Baldi, and Cristina Lopes. 2006. Sourcerer: A Search Engine for Open Source Code Supporting Structure-based Search. In Companion to the 21st ACM SIGPLAN Symposium on Object-oriented Programming Systems, Languages, and Applications (OOPSLA '06). ACM, New York, NY, USA, 681-682.
[6]
Paul Barry. 2016. Head First Python: A Brain-Friendly Guide. " O'Reilly Media, Inc.".
[7]
Gareth Baxter, Marcus Frean, James Noble, Mark Rickerby, Hayden Smith, Matt Visser, Hayden Melton, and Ewan Tempero. 2006. Understanding the Shape of Java Software. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications (OOPSLA '06). ACM, New York, NY, USA, 397-412.
[8]
David Beazley and Brian K Jones. 2013. Python Cookbook: Recipes for Mastering Python 3. "O'Reilly Media, Inc.".
[9]
Basil Bernstein. 1960. Language and social class. The British journal of sociology 11, 3 (1960), 271-276.
[10]
Joshua Bloch. 2008. Effective Java (The Java Series). Prentice Hall.
[11]
Jose Dieguez Castro. 2016. Arch linux. In Introducing Linux Distros. Springer, 235-252.
[12]
James William Cooper. 2000. Java design patterns: a tutorial. Addison-Wesley Professional.
[13]
John W Creswell and J David Creswell. 2017. Research design: Qualitative, quantitative, and mixed methods approaches. Sage publications.
[14]
Krzysztof Cwalina and Brad Abrams. 2008. Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable. Net Libraries. Pearson.
[15]
Andreas Dewes and Christoph Neumann. 2018. The Little Book of Python Anti-Patterns. https://goo.gl/xQQNE2. Accessed: 2018-04-21.
[16]
Steve Easterbrook, Janice Singer, Margaret-Anne Storey, and Daniela Damian. 2008. Selecting empirical methods for software engineering research. In Guide to advanced empirical software engineering. Springer, 285-311.
[17]
Joseph Gil and David H Lorenz. 1997. Design Patterns vs. Language Design. In European Conference on Object-Oriented Programming.
[18]
Mark Grand. 2003. Patterns in Java: a catalog of reusable design patterns illustrated with UML. John Wiley & Sons.
[19]
Mark J Guzdial and Barbara Ericson. 2015. Introduction to computing and programming in Python. Pearson.
[20]
Raymond Hettinger. 2013. Transforming Code into Beautiful, Idiomatic Python. https://goo.gl/wgeAvp. Accessed: 2018-04-21.
[21]
Alex Holkner and James Harland. 2009. Evaluating the Dynamic Behaviour of Python Applications. In Proceedings of the Thirty-Second Australasian Conference on Computer Science - Volume 91 (ACSC '09). Australian Computer Society, Inc., Darlinghurst, Australia, Australia, 19-28. http://dl.acm.org/citation.cfm?id=1862659.1862665.
[22]
Michal Jaworski and Tarek Ziadé. 2016. Expert Python Programming. Packt Publishing Ltd.
[23]
Jeff Knupp. 2013. Writing Idiomatic Python 3.3. CreateSpace.
[24]
Mark Lutz. 2010. Programming Python: Powerful Object-Oriented Programming. "O'Reilly Media, Inc.".
[25]
Alex Martelli, Anna Ravenscroft, and David Ascher. 2005. Python cookbook. "O'Reilly Media, Inc.".
[26]
S. McKee, N. Nelson, A. Sarma, and D. Dig. 2017. Software Practitioner Perspectives on Merge Conflicts and Resolutions. In 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME). 467-478.
[27]
R Michael Paige, Helen L Jorstad, Laura Siaya, Francine Klein, Jeanette Colby, D Lange, and R Paige. 2003. Culture learning in language education. Culture as the core: Perspectives on culture in second language learning (2003), 173-236.
[28]
Alan J Perlis and Spencer Rugaber. 1979. Programming With Idioms In APL. In ACM SIGAPL APL Quote Quad.
[29]
Mark Pilgrim and Simon Willison. 2009. Dive Into Python 3. Vol. 2. Springer.
[30]
Luciano Ramalho. 2015. Fluent Python: clear, concise, and effective programming. " O'Reilly Media, Inc.".
[31]
Mari Rege. 2008. Why do people care about social status? Journal of Economic Behavior & Organization 66, 2 (2008), 233-242.
[32]
Kenneth Reitz and Tanya Schlusser. 2016. The Hitchhiker's Guide to Python: Best Practices for Development. "O'Reilly Media".
[33]
Per Runeson, Martin Höst, Austen Rainer, and Björn Regnell. 2012. Case Study Research in Software Engineering. Wiley-Blackwell.
[34]
Brett Slatkin. 2015. Effective Python: 59 Specific Ways to Write Better Python. Pearson Education.
[35]
Michael Smit, Barry Gergel, H James Hoover, and Eleni Stroulia. 2011. Code Convention Adherence in Evolving Software. In International Conference on Software Maintenance.
[36]
Igor Steinmacher, Tayana Uchôa Conte, Christoph Treude, and Marco Aurélio Gerosa. 2016. Overcoming open source project entry barriers with a portal for newcomers. In Proceedings of the 38th International Conference on Software Engineering, ICSE 2016. 273-284.
[37]
Igor Steinmacher, Marco Aurélio Graciotto Silva, Marco Aurélio Gerosa, and David F. Redmiles. 2015. A systematic literature review on the barriers faced by newcomers to open source software projects. Information & Software Technology 59 (2015), 67-85.
[38]
Chandrasekar Subramaniam, Ravi Sen, and Matthew L Nelson. 2009. Determinants of open source software project success: A longitudinal study. Decision Support Systems 46, 2 (2009), 576-585.
[39]
Winston M Tellis. 1997. Application of a case study methodology. The qualitative report 3, 3 (1997), 1-19.
[40]
Ewan Tempero, Craig Anslow, Jens Dietrich, Ted Han, Jing Li, Markus Lumpe, Hayden Melton, and James Noble. 2010. The Qualitas Corpus: A Curated Collection of Java Code for Empirical Studies. In Proceedings of the 2010 Asia Pacific Software Engineering Conference (APSEC '10). IEEE Computer Society, Washington, DC, USA, 336-345.
[41]
Brian Uzzi. 1996. The sources and consequences of embeddedness for the economic performance of organizations: The network effect. American sociological review (1996), 674-698.
[42]
Guido van Rossum, Barry Warsaw, and Nick Coghlan. 2001. PEP 8: style guide for Python code. Python.org. https://goo.gl/crVen9.
[43]
Tarek Ziadé. 2008. Expert Python Programming. Packt Publishing Ltd.
[44]
Manuela Züger, Sebastian C. Müller, André N. Meyer, and Thomas Fritz. 2018. Sensing Interruptibility in the Office: A Field Study on the Use of Biometric and Computer Interaction Sensors. In Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems (CHI '18). ACM, New York, NY, USA, Article 591, 14 pages.

Cited By

View all
  • (2024)Refactoring to Pythonic Idioms: A Hybrid Knowledge-Driven Approach Leveraging Large Language ModelsProceedings of the ACM on Software Engineering10.1145/36437761:FSE(1107-1128)Online publication date: 12-Jul-2024
  • (2024)Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by ExampleProceedings of the ACM on Software Engineering10.1145/36437551:FSE(631-653)Online publication date: 12-Jul-2024
  • (2024)SBFT Tool Competition 2024 - Python Test Case Generation TrackProceedings of the 17th ACM/IEEE International Workshop on Search-Based and Fuzz Testing10.1145/3643659.3643930(37-40)Online publication date: 14-Apr-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
Onward! 2018: Proceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software
October 2018
146 pages
ISBN:9781450360319
DOI:10.1145/3276954
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 October 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Community
  2. Conventions
  3. Culture
  4. Idioms
  5. Programming
  6. Python
  7. Pythonic

Qualifiers

  • Research-article

Conference

SPLASH '18
Sponsor:

Acceptance Rates

Overall Acceptance Rate 27 of 62 submissions, 44%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)52
  • Downloads (Last 6 weeks)3
Reflects downloads up to 21 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Refactoring to Pythonic Idioms: A Hybrid Knowledge-Driven Approach Leveraging Large Language ModelsProceedings of the ACM on Software Engineering10.1145/36437761:FSE(1107-1128)Online publication date: 12-Jul-2024
  • (2024)Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by ExampleProceedings of the ACM on Software Engineering10.1145/36437551:FSE(631-653)Online publication date: 12-Jul-2024
  • (2024)SBFT Tool Competition 2024 - Python Test Case Generation TrackProceedings of the 17th ACM/IEEE International Workshop on Search-Based and Fuzz Testing10.1145/3643659.3643930(37-40)Online publication date: 14-Apr-2024
  • (2024)A Study on the Pythonic Functional Constructs' UnderstandabilityProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639211(1-13)Online publication date: 20-May-2024
  • (2024)Hard to Read and Understand Pythonic Idioms? DeIdiom and Explain Them in Non-Idiomatic Equivalent CodeProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639101(1-12)Online publication date: 20-May-2024
  • (2024)The Limits of the Identifiable: Challenges in Python Version Identification with Deep Learning2024 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER60148.2024.00022(137-146)Online publication date: 12-Mar-2024
  • (2024)Deriving modernity signatures of codebases with static analysisJournal of Systems and Software10.1016/j.jss.2024.111973211:COnline publication date: 2-Jul-2024
  • (2024)The downside of functional constructs: a quantitative and qualitative analysis of their fix-inducing effectsEmpirical Software Engineering10.1007/s10664-024-10568-z30:1Online publication date: 22-Oct-2024
  • (2023)Do Developers Present Proficient Code Snippets in Their README Files? An Analysis of PyPI Libraries in GitHubJournal of Information Processing10.2197/ipsjjip.31.67931(679-688)Online publication date: 2023
  • (2023)CodeStylistProceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence and Thirty-Fifth Conference on Innovative Applications of Artificial Intelligence and Thirteenth Symposium on Educational Advances in Artificial Intelligence10.1609/aaai.v37i13.27087(16485-16487)Online publication date: 7-Feb-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media