[fpc-pascal] Re: classes initialization

M Pulis toothpic at fastq.com
Tue Mar 25 13:55:52 CET 2008


>
>> p.s. I think the inconsistent behavior between local scope records  
>> and global scope records is kind of a flaw/danger in modern  
>> pascal.. as the bugs may not be caught until someone builds a  
>> program with local scope var..
>
> Using uninitialised variables is virtually always bad, regardless  
> of the scope. And the fact that global variables are zeroed at the  
> program start is afaik not defined by the Pascal standard. It's  
> just a side effect of the way most operating systems work.
>


Affirmative.

Pascal does not define any variable initialization itself - one  
should always init all Pascal vars of any type. Doing so is an  
excellent coding habit also portable to any other language/OS -  
protects against low-level implementation changes.

I never trust a side effect I didn't code myself..... 8-))

Gary



More information about the fpc-pascal mailing list