3 ms·
> Ada requiring the redundant name after "end" isn't a violation of DRY at all. Yours is an arbitrarily narrow interpretation of the principle. To quote Dave T
by trott 10y ago
> Ada requiring the redundant name after "end" isn't a violation of DRY at all.
Yours is an arbitrarily narrow interpretation of the principle. To quote Dave Thomas, DRY states that
"Every piece of knowledge in the development of something should have a single representation."
The name of your function or block is one such piece.
I agree that having the compiler check the consistency of the redundant statements ameliorates the situation somewhat, but it would be better if the problem wasn't there at all.
[1] http://www.artima.com/intv/dry.html http://www.artima.com/intv/dry.html
- deleted 10y ago[deleted]
- lobster_johnson 10y agoThe page you linked to directly refutes your claim of narrowness: Most people take DRY to mean you shouldn't duplicate code. That's not its intention. The idea behind DRY is far grander than that. [...] DRY says that every piece of system knowledge should have one authoritative, unambiguous representation Note the terms knowledge and representation. He's referring to things like declarations, data models, schemas, facts. Duplicate source code symbols has nothing to do with it. DRY is not "be terse". For example, turning a literal into a constant is DRY, because it reduces to a single "authorative, unambiguous representation". But "x = x + 1" (which certainly looks redundant) is not anti-DRY, nor is "end Foo;".