There are other ways to stay awake besides coffee, although I think coffee is one of my favourites, I guess it's because it's the healthiest way to stay alert haha.
For me coffee helps me feel better, less tired, sometimes I'm a bit down and coffee gives me energy.
I haven't tried staying up all night just drinking coffee but my husband has done it when he was at university and had to study for an exam. So, coffee is also very effective in keeping us alert. In fact that is one of its properties, it is an excellent stimulant.