The Telegraph machines were invented before the Telephone.
(Please Click your cursor on “The American Morse Code” in line 3 below for an explanation from Wikipedia about Codes)
There were two Morse Codes. The first was the International Morse Code which was used by “Ham Radio Operators”, ships at sea, and the military Army, Navy and Air Force. The second Morse Code was the The American Morse Code used by North American Railroads. There were 10 letters different between the 2 codes. The Railroad Telegrapher was a very important employee. He was the middleman between the Train Dispatcher and the employees on the Trains. The Railroads required communication from the railhead construction site to their headquarters with daily reports on how many miles had been laid that day. Some Railroad Telegraphers learned the code by going to Telegraph Schools. Others became Assistant Agents, and learned from the Agent and practised on the Telegraph key and memorized the Rule Book while off-duty. They wrote an examination on rules, and if they passed that, they were sent out as relief Telegraphers until obtaining enough seniority to hold down a permanent position. Another position was the Commercial Telegrapher, who handled Commercial Telegrams and Newspaper traffic, and also communicated with Commercial Telegrams to the Railroad Telegrapher Agents. The experienced Railroad Telegrapher could advance his employment to becoming a Station Agent, or a Train Dispatcher when his seniority allowed.. They were held in great esteem by the Public and the Officials.