It was hard physical labor, but in some places people called it "dancing."
Before automation, "section hands" laid and maintained railroad tracks. In the United States those willing to do this arduous work for low pay, and under poor working conditions, were more than often recent immigrants and minorities.
In the west, these crews were often made up of Chinese, Mexican Americans and Native Americans.
In other areas, different ethnicities performed these functions. In the northeast, most were Irish and in the south they were African American.
One important job of the section hands was constantly straightening the tracks, which got bent as each passing train caused small shifts in them. If left unchecked, these shifts accumulated and eventually caused derailments.
Workers forced five-foot lining bars, or "gandies," under the rail and threw their full weight forward pushing the rail back in place. With each push, they made a "huh!" sound.
It is uncertain why they referred to these lining bars as gandies. Some historians believe they were named for a long defunct Chicago company that had made the tools.
However, researchers have been unable to find the "Gandy" company, and some speculate the movements of the section hands was reminiscent of male geese or ganders.
The workers' constant movement in a rhythmic pattern resembled dancing. As a result, all over the United States, these men were called "gandy dancers."
However, this term was not seen in print until early in the 20th century.
The constant rhythmic "huhs" quickly evolved into singing or chanting which helped the section hands maintain a unifying beat or cadence, similar to when troops marching in a military unit stay in step together by chanting marching tunes.
A "caller" lead the group as both an entertainer and motivator.
The more creative callers could work a ten-hour day without once repeating a chant. Their themes included sea shanties, religious songs, ethnic tunes and military chants.
But all gandy dancers sang railroad songs. The African Americans in the south are best known for their unique chants.
Sometimes tracks needed raising rather than straightening. This required eight or more workers to jack them back up in the low spots by placing the gandy under the ties and pushing up a large number of times.
Gandy dancers had other duties including driving spikes, moving and adjusting track ballasts, carrying rails, pulling weeds, unloading ties and rails, and replacing worn rails and rotten ties.