J.K. Rowling's 8 Rules of Writing Code
Calling Joanne K. Rowling an amazing writer is certainly an understatement. Her Harry Potter universe is a fascinating world and I personally really love the Cormoran Strike novels that she started to publish under a pseudonym. Recently, I happened to stumble over a blog post about Joanne K. Rowling’s 8 Rules of Writing - and realized that they actually also apply to writing code for data analysis. Below is the overview with a few subtle tweaks in italics and bold…
- Be ruthless about protecting
writing dayscoding hours, i.e., do not cave in to endless requests to have “essential” and “long overdue” meetings on those days. The funny thing is that, although writingdata analysis has been my actual job for several years now, I still seem to have to fight for time in which to do it.
- You’ve got to work. It’s about structure. It’s about discipline.
- I stopped pretending to myself that I was anything other than what I was, and began to direct all my energy into finishing the only work that mattered to me.
- Write what you know:
your own interests, feelings, beliefs, friends, family and even petsdomain knowledge, past work and your knowledge about the data collection process and method will be your raw materials when you start writing.
- I always advise children who ask me for tips on being a writer to read code and analyses written by others as much as they possibly can. Jane Austen gave a young friend the same advice, so I’m in good company there.
- Perseverance is absolutely essential, not just to produce all those
wordslines of code, but to survive rejection and criticism.
- What you write becomes
who you arewhat you need to need to fine-tune, deploy into production and maintain… So make sure you love what you write!
- Failure is inevitable — make it a strength. You have to resign yourself to the fact that you waste a lot of
treeshours with data cleaning, exploratory data analysis and developing dozens of preliminary models before you write anything you really like, and that’s just the way it is. It’s like learning an instrument, you’ve got to be prepared for hitting wrong notes occasionally, or quite a lot. I wrote an awful lot before I wrote anything I was really happy with.