Subject: Smoking out pointer-impaired minds?

From: Omer Zak <[email-masked]>
Date: Fri, 18 May 2001 10:38:00 +0300 (EET DST)

It has been said that there are some programmers, who "get" the idea of
pointers.  On the other hand, there are other people, who can never "get"
the idea of pointers no matter how much is the concept explained to them.

My question - is there any simple self-test or another test, which can be
used by an aspiring programmer and/or a prospective employer to find if he
can "get" the idea of pointers or not?
                                             --- Omer
There is no IGLU Cabal.  This time, with no explanations!
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

---

From: Shlomi Fish <[email-masked]>
Date: Fri, 18 May 2001 12:01:03 +0300 (IDT)

> the idea of pointers no matter how much is the concept explained to them.

The first language I learned was GW-Basic. Then I learned C, and when I
learned it pointer was the main thing I could not quite grasp. During a
"Hugey Siyor" trip I attended, I talked with the armed escort and found
out he was an experienced programmer in the IDF.

He explained to me the basic idea behind a pointer, and from then on I
managed on myself. Of course, there were several pointer mistakes which I
had made years after I mastered pointers. (for instance, assuming that
elements of an array of structs will retain their position after the array
is realloced). But, apparently I'm a pointerish person and only needed a
small explanation.

BTW, the first advice he gave me regarding C programming was that I should
not forget the semicolons at the end of the statements. (I expected
something more profound) :-)

> can "get" the idea of pointers or not?

I think everyone can get the idea of pointers with some explanation and
possibly actually showing them how to use them. What I mean is to seat
next to them near a development environment, ask them to program something
that can easily be done with pointers and guiding them on how to do so.

It's also useful to explain about memory organization, and then to use a
debugger to show them how pointers are handled at run-time.

Regards,

	Shlomi Fish

> There is no IGLU Cabal.  This time, with no explanations!

It should have been:

There is no IGLU Cabal. A non-pointerish programmer who doesn't know how
to malloc and use pointers allocated it as a local variable and it
went out of scope.

BTW, I thought about starting a collection of OmerZ's "There is no IGLU
Cabal..." signatures. Perhaps some links to the actual messages themselves
would be the best solution, because they usually have to do with the
E-mail context itself.

> To unsubscribe from this group, send an email to:
> [email-masked]
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 

----------------------------------------------------------------------
Shlomi Fish        [email-masked] 
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

A more experienced programmer does not make less bugs. He just realizes
what went wrong more quickly.