Live data from Hacker News

Write Code Every Day

ejohn.org

131–140 of 221 posts

Re: Write Code Every Day

#131
It's best if you actually just _read_ code everyday and the writing is just the side effect of tinkering with it. Like chess you will save a lot of time by learning from other people's games before you actually do something on your own.

Re: Write Code Every Day

#132
This is a good article. I believe this idea comes from Jerry Seinfeld^1.

Here's an article that really complements the submission: http://start.jcolemorrison.com/how-i-fight-procrastination/ It's titled "How I fight Procrastination" and gives advice on how to break up tasks into day-sized activities.

Finally, I want to say I personally disagree with the OP's 2nd point:

    2. It must be useful code. No tweaking indentation, no code 
    re-formatting, and if at all possible no refactoring. 
    (All these things are permitted, but not as the exclusive work of the day.)
I've noticed that when I'm really tired or "not feelin' it" sometimes I just want to do something that takes 10 minutes so I can keep the chain going. When I spend a day (ie: 10 minutes) refactoring some code, I don't lose my motivation to work on my project tomorrow. It's breaking the chain makes me lose motivation and if I forced myself to write something "useful" on a day I don't feel like it, I may just end up breaking the chain instead. It's of the utmost priority to lower the bar to work on your project and rule 2 is an obstacle to that. Plus, I take mild offense to the idea that refactoring is not considered useful :)

And, if I had this rule I think I'd avoid refactoring a lot of code that needs it. I'd spend more effort squeezing that square feature into that round hole if refactoring "didn't count".

    ^1: http://lifehacker.com/281626/jerry-seinfelds-productivity-secret

Re: Write Code Every Day

#133
Inspirational post.

Last year, I [1] set a goal to teach myself git by committing at least once every day for a month. At the end of this, I saw the streak, and was too afraid to see it go down to 1 in a snap. Ever since, I've been committing code daily, and it's been about 40 weeks, and I'm still going strong. Being a full time student, this wasn't really easy for me, but I'm proud of myself.

The one thing I learned is, that the problem isn't the lack of ideas or time, but the lack of motivation to work on them.

[1] https://github.com/karan

Re: Write Code Every Day

#134
post #98

Earlier quoted context omitted.

[HabitRPG]( http://habitrpg.com ) is totally awesome for this, a great motivator. You can setup "Dailies" so that when you're done writing your daily 500 words, you just check it off. Or set it up as a habit and give yourself a "+" whenever you get a new chapter done. I use it all the time for just these purposes.

This is brilliant. Thanks! Are there any other similar apps out there?

You can use RescueTime to automatically track how you're doing against goals you can configure like "spend at least 1 hour in Sublime Text"

Re: Write Code Every Day

#135
post #2

This "don't break the chain" approach has worked extremely well for me, particularly during busy periods of high stress. I first learned about it in my college writing classes, where you're supposed to write something, anything, meaningless jibberish even, every single morning. Recently I read about Seinfeld using this approach to great successs. Every day he works on material, and puts a big, fat, "X" on the calenda…

Does "dont break the chain" work equally well if you split your goals out by week as by day?

For my personal situation I can't guarantee I would get time to do coding every evening but 2 session a week seems feasible.

Re: Write Code Every Day

#136
post #3

Earlier quoted context omitted.

An important change that I made, compared with these techniques, is that I require myself to write meaningful code. It's certainly much harder to do that but as a result I find myself developing good time management skills. Knowing that I have to be mentally "present" for my work forces myself to schedule and plan my days better, resulting in higher quality work all around!

How do you define meaningful code? I feel like I'd quickly run out of approachable ideas without reinventing some wheel. I'm also not to the point that I can write Node/Python/other packages and have them be useful or unique.

Pick something in your domain and write something useful.

Re: Write Code Every Day

#137
"An interesting side effect of writing side project code every day is that your current task is frequently running in the back of your mind. Thus when I go for a walk, or take a shower, or any of the other non-brain-using activities I participate in, I’m thinking about what I’m going to be coding later and finding a good way to solve that problem."

Is that not a negative? I find it hard to stop thinking about what I'm working on, and it negatively impacts my life. I leave the office after 8 hours, but the next 2 hours are spent turning over problems in my head, and the 2 hours before I sleep are spent on it too. The days that I work on a problem at the office for a few hours and can't unblock myself before leaving are hell. My brain won't turn off until I can get into work the next day and begin on the problem. Some days I will even wake up in the morning or night with answers to the problem. Why is the AWS instance in my head turned on all night long when I'm not even getting paid for it?

Re: Write Code Every Day

#138
post #113
post #37

Earlier quoted context omitted.

The "don't break the chain" rule is brittle: if you do break the chain, your motivation can crater. I think [Beeminder]( http://beeminder.com/ ) has a clever solution to this problem; it gives you a way to track and enforce your goals while being robust to the occasional lapse.

I haven't found this. Because I can still see a calendar that shows all the days I hit my goal, my motivation doesn't suddenly evaporate if I miss a day. One of the keys I think is setting goals that you can't fail at. So rather than "go to gym" which is a hard habit to form, you could start with "do 10 pushups". Eventually once the habit has formed you can step it up, but it's far more valuable to win/succeed every…

On a side note... neat skin... what is that?

Re: Write Code Every Day

#139
post #37

I am a total convert to the "don't break the chain" idea. I started writing a book on game programming[1] about four years ago. At the time, I was working at EA, miserable, and highly motivated to have the book done so it could help pad my resume. I got a book deal (O'Reilly) then, when that fell through, another (Apress). I had a real writing schedule, and a very supportive wife, and I would work on it for hours at…

The "don't break the chain" rule is brittle: if you do break the chain, your motivation can crater. I think [Beeminder]( http://beeminder.com/ ) has a clever solution to this problem; it gives you a way to track and enforce your goals while being robust to the occasional lapse.

I agree, that's what happened to me. Now I have a rule to not go 2 days without working on one of my coding project, so if I miss a day I don't get discouraged.

Re: Write Code Every Day

#140
post #127

I am a total convert to the "don't break the chain" idea. I started writing a book on game programming[1] about four years ago. At the time, I was working at EA, miserable, and highly motivated to have the book done so it could help pad my resume. I got a book deal (O'Reilly) then, when that fell through, another (Apress). I had a real writing schedule, and a very supportive wife, and I would work on it for hours at…

Are you still in the game dev field? Great job on the book by the way. Edit: Oh, are you the one whom Herb Sutter used his benchmark in the Build conference talk about C++ a few days ago?

He works on Dart for Google. I also find him an excellent critic (inclusive of dart) in forums. Some of his insights have cleared up things for me that are expressed vaguely elsewhere in comparison. I would like to see him do something more expansive on the tradeoffs between objects and ADTs (hint hint). Maybe he has done but I can't find it.
Post reply on HN