[Info-vax] Variable declarations, was: Re: improving EDT
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Sat Nov 19 17:18:20 EST 2016
On 2016-11-19, David Froble <davef at tsoft-inc.com> wrote:
> Simon Clubley wrote:
>> On 2016-11-18, David Froble <davef at tsoft-inc.com> wrote:
>>> I've had many criticize me for not declaring all variables. My response has
>>> been "that's the compiler's job, why should I do such work?". Nothing different
>>> in having tools that attempt to do the grunt work for you.
>>>
>>
>> They are absolutely right to criticise you IMHO. Declaring variables
>> is protection against some types of silly typing errors and in more
>> modern traditional style languages this is a requirement (or you
>> get an undeclared variable error during compilation).
>>
>
> So, who died, and left you god of variables?
>
It's an opinion formed from exposure to a good range of programming
languages and environments.
BTW, have you ever tried a type safe language such as Ada or one of
the Wirth languages ? I'm assuming no on the former, but I don't know
about the latter.
Declaring variables is only the very first step towards safer code.
Even _C_ requires that you declare all your variables and that you
declare your intentions by declaring the types of the variables, at
least at a basic level. (However, languages like Ada take it to a far
higher level with the range of strictly enforced user defined types
you get there.)
> It's worked for over 40 years for me.
>
Unfortunately, what works for you doesn't work in other environments.
> YMMV
Very true.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list