DVI stands for Digital Visual Interface and offers a distinctly sharper, better picture than VGA. It can carry both digital and analog signals. DVI can also easily convert to other standards like HDMI and VGA.
DVI comes in three main formats. DVI-I, which includes pins for both analog and digital signals. DVI-D, which includes only enough pins for a digital signal. And DVI-A, which carries only an analog signal. Of these, DVI-D is the most commonly seen male connector, and DVI-I is the most common female connector, due to its ability to accommodate all other formats.
Keep in mind that when using DVI-I cables at extensive lengths, you may not be seeing a digitally-clear image on your screen. Because analog has a much longer run, your display may auto-switch once the digital signal is too weak. For this reason, long runs are best done with VGA (for analog) or HDMI (for digital). If you have no option other than DVI, make sure you're getting the best image by using DVI-D cables and verifying that your display is set to digital input.