TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal Schmidt
from: Roger Scudder
date: 2003-10-23 11:01:00
subject: Memory matters

On: 18 Oct 03  16:26:36 Pascal Schmidt wrote to Roger Scudder:

 >  RS> To me there is no exception.  I would write the cleanup code.  If 
 >  RS> you compiled you code using a memory diagnostic library I am sure it 
 >  RS> would flag the lack of matching calls to free.

 > Sure. I make a distinction between code I write just for my amusement
and code that I intend to release for others to use. In my own personal
stuff, I only do cleanup stuff when it is either needed (because the
allocated memory is not needed any more, but the program continues to run)
or an interesting programming exercise in itself. These are programs I do
just for fun, so I stop where the fun stops. ;) If I release the code, I do
all the cleanup stuff.

 Well, that sure seems like a reasonable justification.  ;-)

 >  RS> If that is the way you choose to write code, that's on you.  I just 
 >  RS> don't like to do it that way.  In a way it's a philosophical thing.  
 >  RS> My philosophy is this; never make assumptions, and leave things the 
 >  RS> way you found them.

 > No argument on the second point, but there are some assumptions about the 
 > runtime environment that one has to make. No program can run without some 
 > kind of context.

 It's a very broad statement.  I should probably change it to "don't
make assumptions about anything that is not defined in the language
standard".    Since this is a C conference, I think we need to be
careful to qualify statements that take in to account implementation
dependent features. 

 > In a way, having to allocate and free dynamic memory by hand is an
indication of 
 > how primitive a language C really is. It has advantages and
disadvantages. You gain 
 > control, but also more opportunities to introduce bugs. ;)

Oh yeah!  big time...  If it wasn't for a personal fondness for the
language, I would probably use it for only a fraction of the things a use
it for now.  If I am being paid for my work, I am VERY cautions about using
C for anything other than small and simple applications.  OTOH, there are
some things that C is simply the defacto king of, like portable interface
definitions.

-Roger

--- Spinone v0.1.79 Win32
* Origin: Scudder's Point (1:261/38.11)
SEEN-BY: 633/267 270
@PATH: 261/38 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.