John Rezig: Write the code every day

Original author: John Resig
  • Transfer
Last fall, work on my side projects came to a standstill: I practically didn’t move forward and I couldn’t manage to do more without sacrificing my main work at Khan Academy .

There were several serious problems in my work organization. I mainly worked on weekends and sometimes in the evenings. As it turned out, this is not the best strategy for me. The need to do as much as possible and better during the weekend put a lot of pressure on me, and if I could not finish the plan, it felt like a failure. The problem was aggravated by the fact that there was no guarantee that the next weekend would be free, and even so - it wasn’t a fact that I wanted to code from morning till night all these two days — sometimes you need to have some fun or just relax.

In addition, a week-long break is too much, it is very easy to forget what you were working on and where you left off, even if you take notes. And if it was not possible to work on the weekend, then the break lasted for two weeks. Such weeks of context switching can be fatal - many of my projects perished without being born from such a lack of attention.

Having heard about the incredible experiment of Jennifer DeWalt , who decided to study programming by creating 180 sites in 180 days, I ventured to try a similar tactic: work on side projects every day.

image
Illustration by Stephen Rezig

I have set a few rules for myself:

  1. I have to code every day. I can do other things - write documentation or articles on a blog, but only in addition to working on code.
  2. It must be a functional code. Fiddling with indentation, reformatting, and, as far as possible, refactoring - do not count. I can do all this, but it cannot be the main part of the daily allowance.
  3. Only code written before midnight counts.
  4. All code must be open and published on Github.

Some of these rules seem far-fetched. Technically, there is no need to write code exclusively until midnight, but I wanted to force myself to stay up until late so that the code was not dirty. It is also not necessary to publish everything written on Github. I needed this rule to be more attentive to the code - think about reuse or modularity as early as possible.

This tactic turned out to be very effective, and now the twentieth week of continuous work is approaching. I wanted to write about it, as it completely changed my work style and greatly influenced my life and state of mind.

image

These changes in work habits have yielded many interesting results:

Minimum working code.I had to allocate at least half an hour a day to work on the code. It is very difficult to write something meaningful in less time, especially considering that you have to remember what you stopped at yesterday. Sometimes I managed to work a little more (but usually no more than an hour), and on weekends it happened that all day.

Programming is a habit. It is important to note that, by and large, I was not very interested in what the diagram from the Github looks like in the picture above. I think this is the most important result of my experiment: the main thing is that you want to change something for yourself, and not make an external impression on someone else with your work. The same is true for any diet or exercise: you will never succeed if you do not do it for yourself.

Victory over anxiety.Before the start of my experiment, I often felt very worried that I did not have time to do “enough” work, or to move “far enough” (although I could not measure this “sufficiency” because side projects did not have specific deadlines). I realized that a sense of progress in work is just as important as progress itself. My eyes opened! As soon as I began to steadily move forward every day, all my anxiety gradually melted away. I was satisfied with the amount of work done and no longer felt obsessed with doing as much as possible in one sitting.

Weekends.Work on the weekends was a key way to achieve significant progress in side projects, as this was the only time I had time to move forward. Now the weekend is not so important - and this is very good. Plans and expectations, accumulated for a week, most often led only to disappointment. I rarely managed to do everything that I had in mind, and this made me give up entertainment next weekend - go to a cafe or museum, take a walk in the park or spend time with a girl. No matter how important side projects are to you, they should not take up a lifetime.

Background processing.An interesting side effect of regular daily work on a project is that your mind starts working on it in the background. Very often, when I just walk down the street, or take a shower, or do something else that does not require mental effort, I think about what I have to do, and often find a solution to current problems. This was not the case when I programmed only once a week. Over the course of a week, my head was occupied with other tasks, or even with concern that I did not have time to work on a side project.

Context switching.Each time, resuming work on a side project, you have to spend time switching contexts. Unfortunately, after a week-long break, this switch is very difficult. Daily work in this sense is much more effective, as breaks are much smaller and context can be restored much faster.

Time management. One of the most important aspects of the experiment for me is that I learned to better distribute the time between work, side projects and the rest of my life. Knowing that I have toto do at least a little daily, I just had to learn how to better plan my day. If I had other plans for the evening, I had to transfer the work on the project to an earlier time, before the start of the main work. If I didn’t have time to work, but was delayed somewhere, I had to return home early to finish, instead of just skipping the day. I admit, I began to have less time for a hobby (engraving ukiyo-e and more), but there is nothing to be done, you have to choose.

External perception.Another plus appears when your loved ones get used to your new rules. My girlfriend understands that I should at least work a little on projects every day, and sometimes I have to plan other things with this in mind. It’s very nice when you can say “Yes, we can go for a walk (go to the cinema, etc.) but after that I need to finish the job” - and know that they will treat this with understanding.

How much code have I written? I can hardly believe how much I managed to write over the past few months. I made a couple of sites, rewrote several frameworks, and wrote a bunch of new modules for Node. I have done so much that sometimes I don’t even remember everything that I wrote - what was just a few weeks ago seems to be a distant past. I am extremely satisfied with the amount of work done.

I believe that my experiment was a huge success and I want to stick to new habits for as long as I can. I highly recommend this tactic to anyone who wants to progress well in their side projects. If you try, let me know if this worked for you or not - I am very interested to hear as many real stories as possible.


Also popular now: