The telegraph was developed around 1830 - 1840 by Samuel Morse and other inventors, which revolutionized long-distance communication.
The electrical signals were transmitted by a wire laid between stations. In addition, Samuel Morse developed a code, called Morse code, for the simple transmission of messages across telegraph lines. Based on the frequency of usage, the code assigned a set of dots (short marks) and dashes (long marks) to English alphabet and numbers.
The telegraph laid major foundations for modern conveniences like telephones and (some scholars argue) coding for the Internet.