Hacker News new | ask | show | jobs
by jacquesm 3401 days ago
This is so true. I usually write things three times: the first time to get a feel for the space, the second to solve the problem at hand. This then gives me actual understanding and them I'm ready to really solve the problem, usually with a fraction of the memory requirements and one or more orders of speed gain and less code to boot.

Very rarely do I hit anything near to an optimal solution the first time out of the gate.

1 comments

Bingo.

1st iteration: 'does it' (barely) but kinda looks hacky 2cnd iteration: better. actually works. 3rd iteration: looks clean, concise, pro, something to be proud of!

3rd time is a charm in software.

It's unbelievable how much clearer and more concise the code is 3rd time around.

If you can ever actually get away with this on a project ... highly recommended.

I would love to have the opportunity to do this is my working life projects as most of the time while I'm doing iteration1, I have various others breathing down my neck about getting the next list of tasks in the sprint done as well. Time, and keeping others away is my hurdle.
The interesting thing is that in the longer term the third iteration will be the winner because it is more maintainable and most likely much easier to understand.
So, ship version one, early, and figure out whether it's worth keeping at all, or whether to kill it and not waste time on versions 2 and 3.