Write whatever, get it down. Out of order, out of the blue? Stick it in the Do Something With This section. Just get it out of your head and saved someplace.
Then you can go back, read it over, rewrite stuff, fix it up and, ideally, cut the shit out of it to make it tight on a serious murder-your-darlings rampage.
def foo(a,b,c):
h = bar(a,b) + bar(b,c)
if h > a + b + c:
h = dothatotherthing(h,a,b,c)
return h
where neither bar, nor dothatotherthing are written yet. (clearly, they have better names than that)That's assuming, of course, you never ever try to solve a problem with anyone else before grad school. That seems possible but highly unlikely.
After five or six lines he stopped, scratched his head, looked at the proof, and crossed out the last line he'd written. Then he looked at it some more. After a couple of minutes he looked up, apologised, and said he'd got stuck and that we'd go back over it in the next lecture.
It was a great relief to me that my own struggles were not the result of laziness or stupidity: some things are just hard, and take a while to get right, and it's rare to be able to write down something in its correct form on the first pass.
He probably just proved the Riemann Hypothesis in his head and got distracted.
Now though, for a 1000-1500 word piece, I spend at least an hour outlining it. Even the outline itself goes through a few drafts before I start trying to add complete paragraphs. I'd rather have a solid grasp on the ideas I want to communicate than on the specific turns of phrase I'll communicate them with. Turns of phrase are a dime-a-dozen. A clearly communicated idea is much harder to find.
A lot of that has come from practice, but I also owe a lot to PG's essays on rapid iteration from mush to presentable product.
There are so many ways to approach writing, it sometimes scares me.