Wish: Variable Not Used Warning
Nick Sabalausky
a at a.a
Thu Jul 10 11:44:11 PDT 2008
"bearophile" <bearophileHUGS at lycos.com> wrote in message
news:g54j46$2e05$1 at digitalmars.com...
> Markus Koskimies:
>> For me, it could even warn about indentation quirks, like:
>>
>> ...
>> if(a == b)
>> do_that();
>> do_that_also();
>> ...
>>
>> ...In which case the compiler could stop and say, that either add {}'s or
>> correct the indentation :)
>
> Or maybe... I have a revolutionary idea: just express to the compiler what
> you mean once, not using two different means that (for mistake) may say
> conflicting things. Let's see... maybe just using indentation? This seems
> a revolutionary idea, surely no one has put it to practice... oh, Knuth
> has expressed the same idea more than 30 years ago... how cute.
>
> Bye,
> bearophile
At the risk of reliving an old discussion...
http://dobbscodetalk.com/index.php?option=com_myblog&show=Redundancy-in-Programming-Languages.html&Itemid=29
In the case of Python (I assume that's the same sort of behavior as the
Knuth you mention), the whole point behind the way it handles
scope/indentation was to correct the problem of source files that have
improper indentation by actually enforcing proper indentation. That's a very
worthy goal. But the problem is in the way it goes about it: Python doesn't
enfore a damn thing with regard to indentaion. It *can't* inforce proper
indentation because it runs around assuming that the intentation it receives
*is* the intended scope. So it can't enforce it just because doesn't have
the slightest idea what the proper indentation for a particular piece of
code would be - that would require separating scope from indentation
and...oh, yea, that's what C-based languages like D do.
More information about the Digitalmars-d
mailing list