In an effort to fill in some gaps in my programming knowledge, I’ve started working through a couple of introductory programming books. Learning Python the Hard Way is especially intriguing because it gives a series of examples for you to type out verbatim.1 Your job is to do so, make sure that the example works correctly, proof the code, and then figure out what it does. The book does have some explanations, but it’s based largely on the idea that you should use reasoning skills and actually figure it out.
For me, this approach has two huge benefits:
- I learn by doing and I learn from concepts. The exercises do a beautiful job of laying problems out conceptually and the “fiddle with it till it works” aspect really helps me get a good grasp of the logic behind the examples.
- Typing in all of the examples by hand provides excellent practice for finding and fixing typos. Especially titchy typos, which are the bane of my existence.
Not only is learning to program good for expanding my problem-solving abilities and improving my ability to edit my work, it’s also helping me to look at language in new ways. When I’m drafting, I tend to get an idea and try out several different iterations of it as I write. While I’m generally pretty good at finding and eliminating conceptual redundancy, I tend to get terminology so ingrained in my conceptualization of a problem that I don’t see repetitious word use. One of my impending Python projects is to write a basic textual analysis program to help me identify over-used words.
Planning this project has been eye-opening because I’ve had to re-think how I understand the basic unit of the word. It’s easy enough to get a computer to count total words or instances of words or to sort words by most to least used; those are basic string manipulations. The tricky part comes in when you start trying to make the computer see over-used roots (active, actively, activity, for example).
I haven’t totally figured out how to solve the problem yet (I suspect that regular expressions are going to be playing a large part), but I’m excited by it. Not only will I get a useful tool out of the deal, but I also suspect that building this project will help me to better understand some of the problems and challenges of more elaborate digital textual analysis.