If I'm going on a ride of over 40 miles or so, I'll usually plan to stop at a convenience store halfway to replenish my water and at that time get a snack. If that's not logistically possible then I would probably bring a snack with me, although if it's particularly hot and I can't get more water I'm probably in trouble anyway! I'm planning on going on a 90+ mile ride soon and I'll stop halfway for lunch but also bring a bag of raisins with me for intermittent snacking.