When I went to driving school they tought us to leave quite some room in fornt of us when stopiing at lights etc. Then when the other car stops behind you you close the gap (or if the car behind you is going to rear end you you have some escape room, ie. always also check for space to get out of the line.) The point being was that also check for trafic behind you when stopping.