Swimming is a very healthy activity that is good for your heart and the rest of your body. It is also well tolerated by many people because it doesn't put extra wear on tear on your knees and hips relative to other exercises such as jogging. While you might want to see while you are doing it, this may prove to be somewhat of a problem.
Wearing your glasses will not provide the same full benefit underwater due to the interposition of the water. As you leave the water, obviously they will remain wet, which will also make you not see quite as well. Contacts are best not worn under the water because of the risk of them coming off in the water. You can keep your eyes closed while you swim, but there is still an increased risk of losing a contact, or of acquiring an infection in the water that is then held on your eye all day long by the contact lens material instead of being swept off in your tears. Likely the best option would be to speak with your optometrist
about custom swim goggles that would provide both protection and be able to be used underwater.