3 ms·
First I write a test. Then I write just enough code to make that test past. Then I refactor my code so that it meets the 4 rules of simplicity. Then I write
by bjclark 17y ago
First I write a test.
Then I write just enough code to make that test past.
Then I refactor my code so that it meets the 4 rules of simplicity.
Then I write another test.
- trafficlight 17y agoHow does this help you concentrate?
- pyre 17y agoI'm thinking it helps concentration by having short small goals and a definite plan for working on them. Sometimes lack of concentration is due to lack of a structured plan of attack on your 'todo' items. Breaking it into small pieces can also help by not making it some sort of 'monumental' task that you feel is going to take a long time causing you to allow yourself time to do other things because the task isn't going to be immediately done.
- bjclark 17y agoThere's no point at which you could be distracted. You write a test, you make it pass. You don't do anything until it passes. As soon as it passes, you write another test. If I want to take a break, I make a test pass, then write the next one, and take the break. When I sit back down, I know exactly where I was: making the test pass.