Developing software is one of those tasks that can take you on tangent after tangent. Sometimes that’s great and sometimes you actually want to get work done.
Timeboxing is setting a specific time period to finish or at least make some headway on a task. Artificial deadlines can create artificial urgency and help motivate you to focus and do only want needs to be done. By setting a time to stop and review, you can prevent yourself from being stuck at a dead end for longer than your should be. You might give yourself a break, try a different task or just ask for help. It also makes tackling a mammoth task more approachable by only committing to a small burst and then you’re away.