I drink when I need to. The amount of water I carry depends on where I'm riding. If I'm unsure of being able to fill up I'll carry a full load. If I can easily refill along the way I don't start out with so much. I get really cautious when it's really hot, and make sure I take a sip or two every few minutes.
I'm diabetic so eating while riding is all about keeping my blood sugar where it should be. I take medicine to lower my blood sugar, but riding also lowers it, so my usual problem is having it go too low while on a ride. I carry my test kit, some food, and some glucose tablets when I ride. If I eat regularly I don't usually have problems, but I go too long without food on a ride, or don't eat something right before I start, I can. I often have to pull over just to test my blood, and if it's low I have to sit, have a snack, maybe a glucose tablet or two, and wait for it to come back up.
I usually have reasons to get off my bike at various times during a ride. If not - if I just keep pedaling for hours - I stop for a break when my butt tells me too. 15 minutes off the bike and reinvigorate one's rear pretty effectively.