The practice in Scotland of giving children a forename that had been borne by a grandfather/grandmother can be helpful to genealogists trying to create a full family tree. These naming customs were frequently followed in the 19th century but died out in the early part of the 20th century as families became smaller.
The system for deciding the first forename of sons and daughters were often along the lines of :
1st son named after paternal grandfather
2nd son named after maternal grandfather
3rd son named after Father
4th son named after the father's eldest brother.
Daughters were named according to:
1st daughter after maternal grandmother
2nd daughter after paternal grandmother
3rd daughter after mother
4th daughter after the mother's eldest sister.
There was also a naming custom involving the use of family surnames from previous genertions as middle names. My mother, Jean Kaye, never understood why she was named "Jean Bruce Kaye" - after all, Bruce is regarded as a male fore-name. She only found out the origin of that middle name when I was researching that Kaye line and found that my mother's maternal grandmother had a middle name of Bruce - derived from her maternal grandmother's maiden surname of Bruce...