James Mullenbach

Home
Blog
GitHub
LinkedIn
Twitter

Learning to be pythonic

20 Mar 2017

Probably the most immediate benefit of coding in Python, as I saw it, was its status as “executable pseudocode.” About 18 months ago, after emerging from the Java- and C-heavy CS core (and using Java in an industry internship), I coded up some Python for the first time in several months, to apply a simple transformation to some dataset I was using.

I remember it took less than 15 minutes from start to finish, which amazed me. The speed of development was obviously aided by its dynamic types, and complete lack of both boilerplate code and compilation.

Now, I’m continuing to find ways to make my code more pythonic, which seems like a less well-agreed upon analogy for elegance in proofs. Recently, I have realized the power of generators and yield. I only used them for the first time recently, and even more recently was able to casually use it - i.e., without thinking too hard about it. I consider those separate milestones!