SlimShadyIAm / ZenYourPython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How To Zen Your Python

Created by Aamir Farooq, University of Twente


What is this?

This website is meant to serve as a complete catalogue of pythonic idioms, or in other words, what makes pythonic code pythonic.

Alexandru and some other researchers wrote a paper called On the Usage of Pythonic Idioms where they conducted a literature review and interviews with experienced Python developers to define what pythonicity is and what the related idioms are. Their result was, as they say, an "inexhaustive list" of idioms.

Using grounded theory, I conducted a literature review of several Python books and also cross referenced it with the results they found, and this website is the result.

This website is part of my paper called How To Zen Your Python, my research project as part of the graduation phase from the University of Twente.

What is pythonicity?

A programming language is not just its syntax and its vocabulary, but also a set of known effective ways to solve actual problems with it. There exists a well-studied category of the conventions and idioms in programming languages such as Java, which can take the form of implementation patterns, formatting rules, calling conventions, naming conventions, etc. Such conventions are referred to as idioms in the software language field, and Alexandru et al. formally define this term as a language feature or "reusable abstraction" that can improve the quality of code.

Much like with other languages, the same concept exists in the Python community, and Python developers call code pythonic when such idioms are used. The pythonicity of a piece of code stipulates how concise, easily readable, and in general terms, "good" the code is.

While the underlying concept of pythonicity is not specific to Python in particular, as other languages have their own sets of conventions and idioms, it is especially pronounced in the Python community. There is a general "feeling" among the community that it goes beyond a set of practices, rather a philosophy that the community strives to uphold. Python developers are in the constant pursuit of upholding the so-called \emph{Zen of Python} rules, such as "There should be one --- and preferably only one --- obvious way to do it.", and "Beautiful is better than ugly. [...] Simple is better than complex."

Resources

About


Languages

Language:HTML 76.5%Language:Python 23.5%