I don't think it works for programming. Sometimes at the end of a pomodoro, I get a sudden burst of inspiration.. and then the pomodoro rings. I'm guessing there's probably a better way to do programming with a similar timeboxing method, but can't figure it out yet.
Maybe something like a 15 minute work by default, keep going if you feel like going, and then stop and do a 5 minute break when you get distracted past the 15 minute line.