Ask HN: What's your secret to programming fast?

2 points by segmondy ↗ HN
Outside of being very familiar with your language, editor, programming environment, libraries, and knowing how to search for existing solutions.

What's your secret to programming fast when confronted with developing a new software that's not the same as something you have worked on in the past?

4 comments

[ 2376 ms ] story [ 1062 ms ] thread
modular programming. keep a portfolio of code snippets for stand alone routines, and for main loop skeletal templates. Tune up resources later. a dot or a square are just as good at representing a rendered image or resource for proof of concept until the artists get thier turn at it.

And dont forget to comment where you leave something hanging like the first half of a bridge, or where you do somthing that is arcane. you want someone else to be able to pick up where you left off if you have a stroke

> modular programming. keep a portfolio of code snippets for stand alone routines, and for main loop skeletal templates.

Emacs makes this simple with Yasnippet.

Surprisingly by moving away from the screen and keyboard, taking a pencil and paper and sketching a rough design and scribbling down notes on the key issues. Then once I have my head sorted, I return to the computer and start coding, using the sketched design to guide my work.

Of course, with this approach the resulting code often ends up looking quite different to my sketched design. The design changes, etc being commented as I go along.

I expect that many readers are shaking their heads. But for me, I don't necessarily see the big picture for a new program in my mind's eye, so this process works for me and I'm more productive compared to when I go straight to the keyboard and screen.