📜 ⬆️ ⬇️

John Resig: Write the code every day

Last fall, the work on my side projects came to a standstill: I practically did not move forward and I could not do anything more without sacrificing my main work in the 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 over the weekend as much as possible and strongly pressed on me, and if I could not complete my plans, 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 if so, it’s not a fact that I want to code all these two days from morning to evening - sometimes you have to somehow have some fun or just relax.

In addition, a week break is too much, it is very easy to forget what you worked on and stopped at, even if you take notes. And if you couldn’t manage to work on weekends, then the break would take two weeks. Such multi-week context switches can be fatal - many of my projects have died, not being born, from such a lack of attention.
')
After hearing about the incredible experiment of Jennifer Dewalt , who decided to study programming, having created 180 sites in 180 days, I ventured to try a similar tactic: to work on side projects every day.

image
Illustration of Stephen Rezig

I set a few rules for myself:

  1. I have to code every day. I can do other things - write documentation or articles to the blog, but only in addition to working on the code.
  2. This must be a functional code. Indenting, reformatting, and, as far as possible, refactoring are not considered. I can do all this, but it can not be a major part of the daily rate.
  3. Only code written before midnight is counted.
  4. All code must be open and published on Github.

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

This tactic was very effective, and now the twentieth week of continuous work is approaching. I wanted to write about it, because it completely changed my work style and greatly influenced my life and mental state.

image

These changes in work habits have brought many interesting results:

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

Programming as a habit. It is important to note that, by and large, I was not very interested in what the diagram with GitHub looks like in the picture above. I think that 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 it not for yourself.

Victory over anxiety. Before starting my experiment, I often felt deeply concerned that I didn’t have time to do “enough” work, or move “enough” far (although I couldn’t measure this “sufficiency”, as side projects had no specific deadlines). I realized that the feeling of progress in work is just as important as progress itself. I opened my eyes! As soon as I began to steadily move forward every day, all my anxiety gradually melted. I was satisfied with the amount of work done and no longer felt an obsession to do as much as possible in one sitting.

Weekends. Work on weekends used to be a key way to make significant progress in side projects, as this was the only time I had time to make good progress. Now the weekend is not so important - and this is very good. Plans and expectations that have accumulated for a whole week, most often led only to disappointment. I rarely managed to do everything that I had in mind, and this made me refuse to have fun next weekend - to go to a cafe or a museum, take a walk in the park or spend time with a girl. No matter how important side projects are for you, they should not take 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. During the week, my head was occupied with other tasks, or even concern about the fact that I did not have time to work on a side project.

Context switch Each time, resuming work on a side project, you have to spend time on context switching. Unfortunately, after a week break, this switch goes with great difficulty. Daily work in this sense is much more efficient, since breaks are much smaller, and the context can be restored much faster.

Time management One of the most important aspects of the experiment for me is that I learned how to better allocate time between work, side projects and the rest of life. Knowing that I would have to do a little every day, I just had to learn how to plan my day better. If I had other plans for the evening, I had to postpone work on the project to an earlier time, before starting the main work. If I didn't have time to work, but I was late somewhere, I had to go home early to finish, instead of just skipping a day. I admit, I have less time left for a hobby (ukiyo-e engravings and others), but there's nothing you can do, you have to choose.

External perception. Another plus comes when your loved ones get used to your new rules. My girlfriend understands that I have to work on projects a little every day, and other things sometimes have to be planned with this in mind. It's very nice when you can say “Yes, we can go for a walk (go to the movies, etc.) but after that I have to finish the work” - and know that they will be treated with understanding.

How much code did I write? 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 I wrote - what was just a few weeks ago seems like a distant past. I am extremely satisfied with the amount of work done.

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

Source: https://habr.com/ru/post/219209/


All Articles