home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!cs.utexas.edu!torn!utcsri!newsflash.concordia.ca!sifon!thunder.mcrcim.mcgill.edu!poly-vlsi!music.mus.polymtl.ca
- From: Steph <CT80@music.mus.polymtl.ca>
- Subject: Re: TVision : BUG in my head or in TV?
- Message-ID: <07JAN93.20698633.0034@music.mus.polymtl.ca>
- Lines: 56
- Sender: usenet@music.mus.polymtl.ca
- Organization: Ecole Polytechnique de Montreal
- References: <30DEC92.02825818.0033@music.mus.polymtl.ca> <dmurdoch.262.725736007@mast.queensu.ca> <30DEC92.14039571.0035@music.mus.polymtl.ca> <1993Jan4.203255.2366@ncsu.edu>
- Date: Fri, 8 Jan 1993 00:09:55 GMT
-
- >
- >This harkens back to a rather ANCIENT debate as to whether a program
- >or operating system should PRE-initialize the memory image to ZEROs
- >or leave whatever garbage values were in memory at the instance of
- >"loading." Bugs due to UNinitialized memory variables SET TO ZERO or
- >NIL (for pointers) are easier to diagnose and are more CONSISTANT in
- >behavior than are UNinitialized memory variable with RANDOM garbage
- >values that "work" sometimes and don't "work" other times.
- >
- >NOTE: MASM and TASM have directives for allocating either memory INITIALIZED
- >to $00 or to be left in garbage state.
- >
- >Therefore, Borland made a design decision. Contrary to Duncans assertion,
- >it is not a "mistake." It is a design decision. Though I do not know
- >the intimate details of Protected Mode programming and Windows programming,
- >I do know that there is a significant difference from DOS programming
- >and MEMORY MANAGEMENT. Therefore, without first hearing a pro- or con-
- >debate on the merits of memory zeroing--or not--in a particular situation,
- >I'd hesitate to criticize TObject memory zeroing.
- >
- >As far as Steph needing to learn to "build" around it (memory zeroing in
- >DOS TV), I'd put forth that I use it to *advantage* and am quite glad
- >it is done. :^)
- >
- >Of course, anyone who bought BP7 also got TV source code and therefore
- >can easily comment out the couple of lines that do the memory
- >zeroing...and find out whether your code generation life is happier and
- >easier! :^)
- >
- >Steve
- >---
- >+------------------------------------------------------------------+
- >| In person: Steve Modena AB4EL |
- >| On phone: (919) 515-5328 |
- >| At e-mail: nmodena@unity.ncsu.edu |
- >| samodena@csemail.cropsci.ncsu.edu |
- >| [ either email address is read each day ] |
- >| By snail: Crop Sci Dept, Box 7620, NCSU, Raleigh, NC 27695 |
- >+------------------------------------------------------------------+
- > Lighten UP! It's just a computer doing that to you. (c)
- >OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
- >
- >.
- >.
-
- I wouldn't use it. Even though TV might zero data fields, Turbo
- Pascal itself doesn't, so in _my_ book it's bad practice to use this
- feature, especially if not all versions do it, for instance.
-
- 'sides, they always thought me that un-initialized variables are a
- bad programming practice. I know that if I were to read someone
- else's code that used hidden features of TVision, I'd quickly get
- lost. I'll stick to doing InitVar := 0, thank you. :)
-
- Steph.
-
-