This famous analogy was made by Sir John Salmond, a prominent legal scholar from New Zealand.
He used this metaphor to compare the two main sources of law: precedent (case law) and legislation (statute law).
He argued that while precedents contain valuable legal principles (the "gold"), a lawyer has to sift through a lot of irrelevant material in judgments (the "useless matter") to find them.
In contrast, he viewed statutes as being like coins minted by the state—clear, precise, and ready for immediate application.