Ask HN: Coder version of 1000 words a day

1 points by nekopa ↗ HN
Hi all,

I am trying to revive my coding skills after a hiatus of almost 20 years. A good piece of advice for writers is that they should write a 1000 words a day. How could I translate this into something for coding? I know the best way to get my skills back is to write code, but what kind of goal should I set myself for this? The reason the 1000 words per day worms for writers is that it gets them writing, doesn't matter what, or what quality, or how they feel, but they must just to put pen to paper. I am trying to figure out how I can make this work for coding. Lines of code per day? Characters per day? Something else? Any ideas would be very appreciated.

11 comments

[ 3.6 ms ] story [ 37.6 ms ] thread
I'd say you should go based on hours or TODO entries per day.
Thanks for the input. I like this idea, but it's hard to measure output. For example, if I put aside an hour a day, some of the time I will be thinking about code, maybe design, but what would be a good measure of how much code I write? LOC, characters, functions... And would it vary depending on language?
Writers can just sit down and write whatever pops into their heads. Programming doesn't work that way. You have to think things through, look at them from different altitudes, all the way from a bird's eye view of the entire project, down to what's going on in this particular function. You might also have to spend a ton of time debugging. These things are too nebulous to measure quantitatively, so you have to measure them qualitatively.
I don't think it should be any different for coding. I probably wasn't too clear in my question. I spend a lot of time designing and putting together systems, but I just don't write code any more. As in actually opening up an editor and just plain writing code. Like a writer, shouldn't I be able to code whatever pops into my head too? For example, sit down and write a small program that will maybe take a bunch of employee schedules (in xml) and find openings and or conflicts in the schedules.
It just doesn't work that way.. I've spent entire days trying to get a feature to work perfectly, often winding up with fewer lines of code than I started with. Were I to judge such progress by lines of code, an achievement would be transformed into a failure.

That's why I suggest going by TODO-list entries. Those are concrete things that you know need to get done. You can even score them in terms of anticipated difficulty, then try to reach a certain number of points per day/week.

Think of yourself more as an editor than an author. An editor might spend a lot of time re-factoring, looking up syntax, trying to make things flow better, asking people for advice, etc. Amassing words and lines isn't your goal.

I'd recommend reading a programming book on a topic that interests you. You'll write better code after reading it, and may be inspired too. Any simple metric such as character count or lines of code are useless. It is much more important to find something interesting to work on, then commit to learning everything necessary to complete it.
Yes, good point, training is something that you can measure quantitatively. Count the number of pages you've read, code golf [1] puzzles you've solved, etc. Good idea.

[1] http://codegolf.stackexchange.com/

I've been seeing a lot about code golf recently, sounds interesting.
They're fun, easily quantifiable, and a good way to get yourself back into the coding mindset. StackExchange has a big group, I believe Reddit might as well.
I find that I am reading too many great programming books at the moment. I never get to the writing better code after part, as I find an even better book to read. the simple metric is meant to only be useful in that it gets me coding. I am working on something interesting at the moment, (TAOCP) but the learning I need to do to complete the books is going to keep me (happily) tied up for years - as I am trying to make sure I completely understand everything I those books. I am just looking for something to kept me coding while I go through the process.
http://projecteuler.net/ is fun. You write programs that yield an specific answer. Paste the answer in to find out if your solution is correct. I clicked around and worked on the questions that seemed the most interesting.

In terms of books, TAOCP may be a bit more general than what I was thinking of. I assumed you were getting back into programming to make something specific. What sort of software do you plan on working on? Answering that question first may help you spend your coding time more effectively.