How to Maintain Momentum for Learning Programs