There seem to be different opinions regarding pulling an all nighter. While some consider it irresponsible and poor time management, others agree that it can be necessary at times. Everyone's body clock is different and while some show no ill effects of being up all night, others look like bad characters from a vampire movie!
All nighters are sometime plain necessary when you have to appear for your tests and haven't had time to study. It is certainly well to stay up studying all night but you won't be at your best mental functions for the test when you need all your wits about you. The logical solution is to avoid all nighters by staying prepared well in advance. Effective management is the key here. When you need to submit a momentous assignment, try hacking away at it, a little at a time. Eventually the ocean will seem like a tiny puddle to cross over. However, it's true that sometimes there's no help for it.
The key is to make it a rare occurrence than a routine happening. Only dire circumstances warrant such a happening. See if you can get an extension on the submission date of the assignment from the professor who handed out the assignments. Different tutors will have different views regarding late assignment submissions. You need to go with your instincts here! It seems more logical to turn a well done assignment at a later date than a poorly done, on time assignment.
In the end, you know what works best for you. Try to find a balance that works for you. However be warned that too many all nighters will have an adverse effect on your health.