For the past year, I’ve been taking a smattering of online programming classes. These are for my personal edification: not because I’m bent on a career change, but because it’s good to stretch your brain once in a while. Coding requires a different manner of problem solving than what I’m used to. Tasks are approached and torn apart in a more hierarchical manner, which can be foreign to a writer/reader of (mostly) linear narratives. But, I wonder if my process for programming can be adapted to writing.
Let me state, coming at this as a 40 year-old, I am probably not the world’s best coder. While I’ve been involved in webdesign for a while, HTML and CSS aren’t true coding languages. My process is probably ugly and possibly backward, but it gets the job done. Still, I apologize in advance to any engineer/coder I know who might read this.
For me, the process of coding goes something like this:
- Decide what the program should do.
- Stare at my blank text editor for 2-3 minutes and mutter “I have no idea what I’m doing” at least twice.
- Really consider what the program needs to do to get the end result and start breaking it down to its smallest components.
- Shrug. Begin to define functions (most of which I’ll need), declare variables (some of which I won’t need), and write print statements that will give me feedback as I test each piece.
- Rare is the code of any complexity that executes as expected the first time…
- Error messages usually point to a specific line. I interpret what I’m being told and go back to step four and correct my error(s).
- Sometimes, the output isn’t at all what I expected and I have to go back to step three and figure out what I’ve made the program do versus what it should do.
- Repeat 3-5 until I have all the pieces working together to create a program that does what I wanted it to do. Remove the half dozen print statements I’ve been using to test various parts.
Now, I’m going to look at these steps to see what I can apply to writing: