Samuel F.B. Morse developed an electric telegraph (1832–35) and then invented, with his friend Alfred Vail, the Morse Code (1838). The latter is a system for representing letters of the alphabet, numerals, and punctuation marks by arranging dots, dashes, and spaces. The codes are transmitted through either a telegraph machine or visual signals.