why ; ?

Don nospam at nospam.com.au
Thu May 8 01:46:39 PDT 2008


Walter Bright wrote:
> Nick Sabalausky wrote:
>> Python's semantically-meaningful indentation was intended to fix the 
>> problem of poorly-indented code by enforcing proper indentation in the 
>> language and compiler. But the problem is, it *doesn't* actually 
>> enforce it. In fact, it *can't* enforce it because it doesn't have 
>> enough information to enforce it. All it really does (and all it's 
>> able to do) is run around *assuming* your code is properly indented 
>> while silently drawing semantic conclusions from those (obviously not 
>> always correct) assumptions.
>>
>> In fact it's really the same root problem as "no variable 
>> declarations". In both cases, the compiler does nothing but assume 
>> that what you wrote is what you meant, thus silently introducing 
>> hidden bugs 1. Whenever you didn't *really* want the new variables 
>> "my_reponse" and "my_responce" in additon to "my_response" 
>> (VB/VBScript coders use "option explicit" *for a reason*), and 2. 
>> Whenever you didn't *really* want to break out of that loop/conditional. 
> 
> That goes back to the point that a language needs redundancy in order to 
> detect errors. Having semantically-meaningful indentation, removing 
> redundant semicolons, and implicitly declaring variables all remove 
> redundancy at the (high) cost of inability to detect common bugs.
> 
> Those things are fine for scripting language programs that are fairly 
> short (like under a screenful). It gets increasingly bad as the size of 
> the program increases.

Implicitly declared variables are probably the greatest of all false 
economies in the programming world.

bugs(no variable declarations) > 100 * bugs(dangling pointers).




More information about the Digitalmars-d mailing list