Big PictureProjectsPython

The Meaning and Importance of the Scratchpad Approach

Python Jupyter Notebook Scratchpad

I won’t delve too deep into work here, but there is one thing we need to touch on. A couple years ago I started using Python to automate my work. In case you don’t know, Python is a programming language that’s great for manipulating data and automating daily tasks. I found that I really enjoyed writing code and also started using JavaScript because I wanted to create websites to distribute projects.

Jumping forward to today, I routinely use Python for things that would normally involve Excel. Much of my work involves some type of data analysis or manipulation and I start projects with a new Python file in the same way you’d normally start with an Excel file. Much to the horror organized people, I name every new file the same thing: Scratchpad_projectName.

Note: Scratchpad is one just one of my naming conventions and I follow other seemingly disorganized conventions. For example, I name input files dukkha for all projects I’m not interested in. (Dukkha roughly translates as suffering, unhappiness, or pain)

Generally there’s some broad idea or need that triggers a new project. That broad idea is the framework for moving forward. The Scratchpad is the workplace for taking a broad idea and moving through the steps to get there. In other words, the Scratchpad is iterative.

In the world of Python the Jupyter Notebook (JNB) has become very popular and it’s my preferred platform for iteration. The JNB allows you to execute little chunks of code. When you’re working through an idea, you can output values and then pull the code up into the main code body. The process of executing little code blocks encourages iteration and it leads to rapid development and learning.

Writing and executing little chunks of code seems somehow addictive. You come up with logic and execute it for immediate feedback. It’s easy to feel like you’re a mouse hitting a lever for food when you’re running cells and everything is going smoothly.

After I work through the logic of a project, I have a notebook that can perform some type of automated action or data manipulation. The next step is usually taking the code and moving it into a script file. The script file just runs the logic and I don’t use them for exploring ideas. Script files (.py files) are the final output and just get named based on their purpose. They never have the honor of being named Scratchpad because in my workflow they’re complete.

The Scratchpad approach implies some degree of self trust and belief. When you begin a project you don’t know the exact code you need to complete it, but you believe that you can work through the problem until you find a solution. Working through a problem outside of a Jupyter Notebook feels philosophically different and almost like you’re saying you know the solution. I enjoy the process of exploring and discovering more than knowing.

When I think about life outside of work, I’ve started to ask how I can approach things with a Scratchpad mentality. For example, what would this site look like if I took an iterative approach to my projects. I have art projects, code projects, and occasionally other things as well. Why shouldn’t those all fit together somehow? For that matter, how can I experiment with them all in a way that they come together?

The Scratchpad Approach feels like it has lower consequences and that makes it more fun. You try things out and try to get them to work. Sometimes they work and other times you end up trying and trying and trying. In the end, most projects come together somehow even though you don’t know the solution in advance (or at least I don’t).

The best part is that the Scratchpad Approach doesn’t carry a bunch of heavy expectations so there’s nothing to lose. It effectively converts projects into experiments. In many cases, those experiments lead to different ways of thinking about the initial project and new ideas.

Many of my more interesting ideas have come about from starting to work on a project. It’s not thought up in advance. It’s like there’s some body of interesting ideas that can only be accessed by taking action. We can’t think our way to those ideas, but we get little glimpses of them when we start doing the work. The Scratchpad Approach is my preferred way to do the work.

0 0 vote
Article Rating

Leave a Reply

Inline Feedbacks
View all comments