Python Front-end to GCC
Mark Lawrence
breamoreboy at yahoo.co.uk
Thu Oct 24 23:40:30 EDT 2013
On 22/10/2013 18:37, Oscar Benjamin wrote:
>
> OTOH why in particular would you want to initialise them with zeros? I
> often initialise arrays to nan which is useful for debugging. It means
> that you can see if you made a mistake when you were supposed to have
> initialised everything to useful values. In many contexts it would be
> difficult to distinguish between a valid zero and a zero because you
> haven't yet inserted a value. This kind of error can show up more
> quickly if you don't zero the memory since the uninitialised values
> will often be out of range for what you expected and will give very
> noticeable results (such as a seg-fault).
>
In his book "Writing Solid Code" Steve Maguire states that he
initialises with 0xA3 for Macintosh programs, and that Microsoft uses
0xCC, for exactly the reasons that you describe above.
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
More information about the Python-list
mailing list