3 ms·
I start by writing a small amount of code at a level i understand. I add unit tests demonstrating that it behaves as it should. I attempt to improve it via a s
by codeonline 4y ago
I start by writing a small amount of code at a level i understand.
I add unit tests demonstrating that it behaves as it should. I attempt to improve it via a single small change and add tests validating this new behaviour is working as it should. I commit at each step too. I do this to ensure that the gap between my understanding at the last step and this new step is concise and easily testable. I try to be patient with this process, slowing adding functionality.
It's slow, even tedious but methodical. After an hour or two you look at what you've got and as a whole it's impressive.
Adding unit tests with every step as you go and committing at every success means you're continually 'saving your game' and can just revert / commit at every step.
I find this approach means you don't hit the 'its all too hard' barrier.