The Parseltongue Chronicles: My Adventures with Python

Recently, I have been privileged to work with some really smart and experienced people on building a RAG-based copilot solution for customer-support ticket management.

I have never written professional code in Python before, and my impression of Python code I’d seen so far was that it wasn’t very elegant.

True to form, looking at the five or six files that I had to start with, I was faced with long functions, deeply entangled concerns, a morass of “helper functions” which alleviated code replication, and a deep obfuscation of underlying patterns.

My colleagues, knowing my bent for FP, jokingly prodded that what the code really needed was more monads. (How right they were!)

I learned a lot about Python as I got stuck in—first with the elegance of list comprehensions, the similarity—with F#—of significant whitespace, and the ease-of-use of Python notebooks when I needed to quickly test out something.

This series of blog posts aims to catalogue some of my learnings and encourage other programmers who haven’t tried Python to jump in and give it a shot. I’ve discovered a few things, corrected a few (common) misconceptions, made a few friends, realized the usefulness of ChatGPT as a coding companion, and ultimately achieved something I didn’t think was possible: I had a smile on my face writing Python code—a smile I’d only had before when writing F#!

Join me on my journey.