3 ms·
I understand the rationale, but I see a problem with this, and a better system. The problem is that you might be juggling 30 things in your head while writing
by crazygringo 13y ago
I understand the rationale, but I see a problem with this, and a better system.
The problem is that you might be juggling 30 things in your head while writing that code. When you come back tomorrow, you have to start remembering them all, and you're more likely to forget one of them, and spend time debugging later to fix the resulting lesser-quality code.
The better system (in my opinion) is to finish your code for the day, it will leave you feeling good and accomplished. But before you leave, write a to-do list for tomorrow's code, with detailed notes, while the code is still all fresh in your head. Then you can go home and not think about work, and truly relax, and know you'll get to the office tomorrow knowing exactly what you need to start with, and won't be forgetting anything important.
And I'm not sure the analogy with fiction writing is useful -- writer's can suffer from writer's block, so leaving a paragraph can help jump-start the creative part. I've never heard of programmers suffering from coder's block.
- jcutrell 13y agoI think conceptually that the hope is still the same. If you leave your code in a broken state, it will take some practice, but the idea is that it will liberate you from having to try to carry the cognitive load, because you have a natural reminder. Also, if you are juggling 30 things, you're likely not writing your code well as a principle; limiting your work in progress will allow your "breaking" to be limited to a specific function/algorithm/task/unit test (or whatever).
- mmahemoff 13y agoYou have a point about not leaving with the big fragile stack inside your head. But see my example's TODO - it's really leaving after I've just resolved a lot of tension by solving a big problem and now I'm able to restart with more of a low-level grinding task. So I guess there's really more to it than just leaving the code in broken state. I mean it's broken in that you've deliberately created a syntax error, but the next step can still be very straightforward. Sort of like a broken test, which others have mentioned is a good variant of this practice.
- barrkel 13y agoThere are two separate problems. One is getting something easy to gnaw on, to get into flow, to remove the inclination to procrastinate. The other is picking up where you left off.
- ollysb 13y agoI prefer to write a pending test, that way I can just run my tests the next day and get into the groove again.