About Go, D module naming

bearophile bearophileHUGS at lycos.com
Sat Dec 22 00:53:48 PST 2012


Jonathan M Davis:

> You're basically asking for a feature to be added to the
> language so that the compiler will be able to tell you where
> your code is messy without complaining about legitimate code,
> _and_ your suggestion would make the legitimate code messier.

Here you are right only in principle, but not in practice: in 
general legitimate uses of unused variables is not common, so the 
total amount of noise added is not large. And most of such 
legitimate uses are in library code, that is usually not seen by 
programmers.


> I really don't think that it's the compiler's job to tell you 
> whether you have messy code or not. It's the compiler's job to
> tell you whether you have errors in your code or not.

I think it depends on the specific cases and the specific 
definitions of "messy". If I disallow code patterns like "(!x & 
y)", they are not always bugs, but they are often cases of 
"messy" code, that I think it's worth disallowing.

Bye,
bearophile


More information about the Digitalmars-d mailing list