I have to say that though my experiences with the programming are only small I have already been in a situations when I had "just to change one number" ending with a completely rewritten code

And that meant some 100 lines, and even then it was often rather hard to keep everything running even after the change - in fact it'd be simpler to rewrite it from scratch... Well, maybe that was our professor's point
