 He was educated at Rugby School, and at Balliol College, Oxford where he was a favoured student of Benjamin Jowett.He became a Scottish Advocate in 1862 and was legal secretary to the Lord Advocate for Scotland from 1870 to 1874.In 1873 he published "Manual of the Education Act for Scotland".