Unused variables and bugs

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 19:48:05 PDT 2014


On Fri, 22 Aug 2014 21:46:44 +0000
bearophile via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> What better alternative do you suggest in practice?
don't declare unused variables. really, this is extremely easy. my 15+
years of expirience in writing projects of different scale shows that
good decomposition, code architecture and scopes allows to not declare
variable "just in case we'll need it later".

there is no more punch-cards and teletypes, we have good text editors
and we can easily add any necessary declaration just when we need it.

and when compiler complains about unused variable, this indicates that
i either forgot to code something or forgot to do a cleanup after
previous code version.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140823/28a33e51/attachment.sig>


More information about the Digitalmars-d mailing list