|
|
|
Ask HN: How do you “pre-code”?
|
|
17 points
by webappsecperson
2228 days ago
|
|
I've started writing more pseudocode before tackling problems and it's helped a lot in sussing out the general control flow / structure of what I intend to write, basically helping with the programming equivalent of writer's block. It got me to wondering - what else do people do before ever putting hands to keyboard? Obviously there's documentation, meetings with stakeholders, project prep as this whole thing, but I was thinking more for narrower concerns - you're adding a small feature on a mature product or writing a one-off script - what do you try and do beforehand? |
|
If the solution is trivial and can be completed in an hour, I'll just code it from there.
If I think it'll take a day or more, I'll write down both the problem, and potential solutions, along with pros and cons for each approach, with the focus on trying to justify my actions to Future Me.
If I think multiple people are going to want to know how it ticks, I'll write a design doc and share it with some beta users.
I've found it to be frustratingly common that when I skip this process I will code the first solution that comes to me. This frequently is neither the simplest to implement nor the most efficient approach.