Re: "no variable or argument declarations are necessary."



Op 2005-10-04, Steve Holden schreef <steve@xxxxxxxxxxxxx>:
> Paul Rubin wrote:
>> Antoon Pardon <apardon@xxxxxxxxxxxxxxx> writes:
>>
>>>>Or you just code without declaring, intending to go
>>>>back and do it later, and invariably forget.
>>>
>>>What's the problem, the compilor will allert you
>>>to your forgetfullness and you can then correct
>>>them all at once.
>>
>>
>> Thiat in fact happens to me all the time and is an annoying aspect of
>> Python. If I forget to declare several variables in C, the compiler
>> gives me several warning messages and I fix them in one edit. If I
>> forget to initialize several variables in Python, I need a separate
>> test-edit cycle to hit the runtime error for each one.
>
> Well I hope you aren't suggesting that declaring variables makes it
> impossible to forget to initalise them. So I don;t really see the
> relevance of this remark, since you simply add an extra run to fix up
> the "forgot to declare" problem. After that you get precisely one
> runtime error per "forgot to initialize".

Declaration and initialisation often go together. So the fixup
to declare is often enough a fixup for the initialisation too.

--
Antoon Pardon
.



Relevant Pages

  • Re: "no variable or argument declarations are necessary."
    ... the compilor will allert you ... If I forget to declare several variables in C, ... >> forget to initialize several variables in Python, ... > runtime error per "forgot to initialize". ...
    (comp.lang.python)
  • Re: Setting pointer to null!
    ... I think this debugging fetaure emerged originally ... developer forgets to initialize a variable and it accidentally ... to declare a bunch that would be "initialized" in relatively distant code. ... because you prevent the compiler from initializing them ...
    (microsoft.public.vc.language)
  • Re: Replicating results
    ... gradient calculation used in a large optimization routine. ... It will make sure that if you do something like declare a variable called "x1" and use a variable called "xl" the compiler will tell you that xl was undeclared. ... Make sure that you initialize all of your variables, ...
    (comp.lang.fortran)
  • Re: question on scope of a variable
    ... G'day "Chip Orange", ... If I have a std code module and declare at the top of it, ... >to be able to initialize it, or have access to it's value if it's ... >While this compiles for me, I'm getting a runtime error that indicates the ...
    (microsoft.public.word.vba.general)
  • Re: [Eclipse] How to fix indentations.
    ... Why do you declare the list static but initialize it in the ... the method that picks and displays the random fortune, ... The variable should be of the interface type, ...
    (comp.lang.java.help)