Glasses are prescribed for a variety of reasons. Many people consider them a "crutch" that weaken the eyes but that is not always the case. Many times, glasses are used as a temporary correction (to relieve eyestrain, for example) or to allow the eyes to work with less effort. Be sure to ask your doctor for which situations the glasses should be used.
Carrots are an excellent source of nutrition. They do contain the nutrient "beta-carotene", which is a good antioxidant. However, while beta-carotene is good to take, it doesn't change the power of the eye to see clearly and does not convert to the required vitamin A that we need more as we age. Nutrition is discussed in much more detail in "Smart Medicine for Your Eyes".
Using a computer is just like much of the "near viewing" you would do reading books; it requires the eyes to focus up close. While there are certainly differences in the viewing situation, the amount of near-viewing focusing is what creates eyestrain. However, good "ergonomic" principles do apply. See "Visual Ergonomics in the Workplace" for more details.