At an early period of his life David contributed to Cobbett's Political Register a reply to the editor on a question of political economy. He also became a contributor to the Edinburgh Review shortly after its commencement. In 1807 he published a pamphlet on the volunteer system originated by Pitt, which attracted considerable attention. The following year he accepted an invitation to start in Edinburgh a liberal newspaper, the Weekly Register. The paper did not live above a year, and on its discontinuance he transferred his services to the Caledonian Mercury which he continued to edit from 1810 to 1827, when he accepted the editorship of the Edinburgh Courant. This paper he edited until his death.