You have probably heard a warning against jumping in the pool right after eating. Although it is perhaps okay to swim after a meal, you may want to wait at least 30 minutes to avoid muscle cramps.
Generally, if necessary, you should eat fast carbs before and workout. After a workout, you have to eat to replenish your glycogen stores. Learn more about carbs before or after a workout.