I have to agree with the professor on studying math, but I
have to say that it is very strongly subject specific. With
a subject that builds on itself like math or any language,
you really cannot cram a significant chunk in at midnight
before your test. So study a little through the term and
get your sleep. However with subjects based on large
numbers of facts, such as biology, you most definitely can
cram and should.
Therefore while I agree that cramming won't help in math,
it certainly will help in a lot of subjects.