When I'm writing code, and building something complicated, there's this place I usually get to where I'm about to write "the hard line of code". Usually, I've just finished setting up a bunch of code to aggregate the data I need both to read and update, getting the locks I need, and other housekeeping chores, and now I're going to write the complicated bit of arithmetic or really subtle conditional that's going to compute the outcome value or decide whether to include the record or whatever the goal is. I always pause involuntarily and lean back. Then one of a few things happens:

  1. Most often, I realise that I haven't got my data marshaled or resources locked or house generally kept properly, so I have to back away and go back and do some refactoring. The lesson here is that you often don't really understand the problem until you write the code. This is true both at the macro level (you can't fully understand the user requirements until you start writing the code) and at the micro level (you can't fully understand the data marshalling requirements until you write the one short sequence of code that uses it all.
  2. Quite often, I stop and go get a coffee (or write a note like this). The actual reason for this is pure bone-laziness, my brain realises it's about to be asked to really stretch out for a moment and interposes a displacement activity. But I'm not sure it's a problem, often when I'm getting the coffee I suddenly realize that I'm actually in situation #1 and I'm not quite ready to write the code.
  3. I just write the code. But almost never without recourse to one or both of the previous steps, sometimes multiple times.

ongoing
software · G & M · Dad author · colophon · rights
picture of the day
Around January 28, 2003: Examples, Examples, Examples! · Q and 1 are Too Close Together · dot-Emacs · Decades-old Web Authoring Technology · Damn, is the UI Ever Slow

What?
· Technology (61 fragments)
· · Coding (72 more)


Serif · Sans-Serif
I work at Sun Microsystems. The opinions expressed here are my own, and neither Sun nor any other party necessarily agrees with them.