Sei sulla pagina 1di 3

Write Code Every Day

Last fall, work on my coding side projects came to a head: I wasnt making adequate progress and I couldnt find a way to get more done without sacrificing my ability to do effective work at Khan cademy! "here were a few major problems with how I was working on my side projects! I was primarily working on them during the weekends and sometimes in the evenings during the week! "his is a strategy that does not work well for me, as it turns out! I was burdened with an incredible amount of stress to try and complete as much high quality work as possible during the weekend #and if I was unable to it felt like a failure$! "his was a problem as theres no guarantee that every weekend will be free % nor that Ill want to program all day for two days #removing any chance of rela&ation or doing anything fun$! "heres also the issue that a week between working on some code is a long time, its very easy to forget what you were working on or what you left off on #even if you keep notes$! 'ot to mention if you miss a weekend you end up with a two week gap as a result! "hat massive multi(week conte&t switch can be deadly #Ive had many side projects die due to attention starvation like that$! Inspired by the incredible work that )ennifer *ewalt completed last year, in which she taught herself programming by building +,- web sites in +,- days, I felt compelled to try a similar tactic: working on my side projects every single day!

Illustration by .teven /esig I decided to set a couple rules for myself: +! I must write code every day! I can write docs, or blog posts, or other things but it must be in addition to the code that I write! 0! It must be useful code! 'o tweaking indentation, no code re(formatting, and if at all possible no refactoring! # ll these things are permitted, but not as the e&clusive work of the day!$ 1! ll code must be written before midnight! 2! "he code must be 3pen .ource and up on 4ithub!

.ome of these rules were arbitrary! "he code doesnt technically need to be written before midnight of the day of but I wanted to avoid staying up too late writing sloppy code! 'either does the code have to be 3pen .ource or up on 4ithub! "his just forced me to be more mindful of the code that I was writing #thinking about reusability and deciding to create modules earlier in the process$! "hus far Ive been very successful, Im nearing 0- weeks of consecutive work! I wanted to write about it as its completely changed how I code and has had a substantial impact upon my life and psyche!

5ith this in mind a number of interesting things happened as a result of this change in habit: Minimum viable code. I was forced to write code for no less than 1- minutes a day! #Its really hard to write meaningful code in less time, especially after remembering where you left off the day before!$ .ome week days I work a little bit more #usually no more than an hour$ and on weekends Im sometimes able to work a full day! Code as habit. Its important to note that that I dont particularly care about the outward perception of the above 4ithub chart! I think thats the most important take away from this e&periment: this is about a change that youre making in your life for yourself not a change that youre making to satisfy someone elses perception of your work! "he same goes for any form of dieting or e&ercise: if you dont care about improving yourself then youll never actually succeed! Battling anxiety. 6rior to starting this e&periment I would frequently feel a high level of an&iety over not having completed 7enough8 work or made 7enough8 progress #both of which are relatively unquantifiable as my side projects had no specific deadlines$! I reali9ed that the feeling of making progress is just as important as making actual progress! "his was an eye(opener! 3nce I started to make consistent progress every day the an&iety started to melt away! I felt at peace with the amount of work that I was getting done and I no longer had the over(bearing desire to frantically get any work done! Weekends. 4etting work done on weekends use to be absolutely critical towards making forward momentum #as they were, typically, the only time in which I got significant side project coding done$! "hats not so much the case now % and thats a good thing! :uilding up a weeks(worth of e&pectations about what I should accomplish during the weekend only ended up leaving me disappointed! I was rarely able to complete all the work that I wanted and it forced me to reject other weekend activities that I enjoyed #eating dim sum, visiting museums, going to the park, spending time with my partner, etc!$ in favor of getting more work done! I strongly feel that while side projects are really important they should not be to the e&clusion of life in general! Background processing. n interesting side effect of writing side project code every day is that your current task is frequently running in the back of your mind! "hus when I go for a

walk, or take a shower, or any of the other non(brain(using activities I participate in, Im thinking about what Im going to be coding later and finding a good way to solve that problem! "his did not happen when I was working on the code once a week, or every other week! Instead that time was consumed thinking about some other task or, usually, replaced with an&iety over not getting any side project work done! Context s itch. "heres always going to be a conte&t switch cost when resuming work on a side project! ;nfortunately its e&tremely hard to resume thinking about a project after an entire week of working on another task! *aily work has been quite helpful in this regard as the time period between work is much shorter, making it easier to remember what I was working on! Work balance. 3ne of the most important aspects of this change was in simply learning how to better balance work<life<side project! Knowing that I was going to have to work on the project every single day I had to get better at balancing my time! If I was scheduled to go out in the evening, and not get back until late, then I would need to work on my side project early in the day, before starting my main Khan cademy work! dditionally if I hadnt finished my work yet, and I was out late, then Id hurry back home to finish it up #instead of missing a day$! I should note that Ive been finding that I have less time to spend on hobbies #such as woodblock printing$ but thats a reasonable tradeoff that Ill need to live with! !ut ard perception. "his has all had the added benefit of communicating this new habit e&ternally! =y partner understands that I have to finish this work every day, and thus activities sometimes have to be scheduled around it! Its of considerable comfort to be able to say 7>es, we can go out<watch a movie<etc! but I have to get my coding in later8 and have that be understood and taken into consideration! "o much code as ritten# I have a hard time believing how much code Ive written over the past few months! I created a couple new web sites, re(wrote some frameworks, and created a ton of new node modules! Ive written so much I sometimes forget the things Ive made % work from even a few weeks prior seem like a distant memory! Im e&tremely pleased with the amount of work that Ive gotten done! I consider this change in habit to be a massive success and hope to continue it for as long as I can! In the meantime Ill do all that I can to recommend this tactic to others who wish to get substantial side project work done! Let me know if this technique does, or doesnt, work for you % Im very interested in hearing additional anecdotes? $ohn /esig http:<<ejohn!org<blog<write(code(every(day<

Potrebbero piacerti anche