When exercising it is important to have all the energy that you need for your session, and we can often be tempted to eat just before hand if we are feeling peckish. Eating immediately before doing exercise is not healthy as it will not provide the body with the full energy gained from this food. And an athlete must have energy that equals what he consumes before and during his exercise. The most important source of fuel for muscles is carbohydrates that is stored in the form of glycogen. That's why you should eat after doing exercise to be good during the next session.
You should eat before you exercise by about 1 to 4 hours (The ideal time to get your meal fully digested) and it depends on the nature of your meal. Exercising on a full stomach is really bad as you will feel nausea and cramping and other stomach symptoms. If you push yourself hard, your body will even make you vomit, as the energy your stomach needs is binge diverted to your exhausted muscles. If you have an early exercise or race, you should get up early to get your pre exercise meal. If you were late you should drink something that gives you energy because drinking is easier for the stomach to digest. It will take about 20 to 30 minutes. But don't ever eat or drink just before your exercise.
Glucose is the best energy source for human body, so you must include rich carbohydrates food in your meal and it must be easily digested, such as: breads, fruits, pasta and drinks. Sometimes eating sugar (glucose) 30 minutes before exercise is very helpful but it varies from one to another, so you should experiment with it by yourself because sometimes the sudden increase in blood glucose has a bad effect on the performance, that's why you should find out what works for you.
Caffeine is great because it is a powerful stimulant for the Central nervous system. So drinking coffee or one of the many energy drinks on the market is useful before the exercise. Although caffeine is again dependant on the individual and has many dramatic side effects for some. There are some people that are sensitive to caffeine and can experience these side effects such as: headache, nausea and muscle tremors. Also excessive caffeine has strong diuretic effect that may cause dehydration which will decrease your performance.