Sjoerd Job Postmus wrote:
I would not even want to call it a violation. DRY is about having 1 representative location for knowledge. The name of a variable (1) hardly counts as knowledge and (2) is also used at other locations (use-sites).
I don't know whether it meets the strict definition of DRY or not, but the reason it's annoying is that it's a repitition that doesn't convey any information.
Using a variable name in multiple places tells you something: "this thing here refers to that thing defined over there". But having the variable name in two places in the *definition* tells you nothing.