Re: Interesting article by Joel Spolsky: The Perils of JavaSchools



)> There are different solutions for this. For example, you could point back
)> to the first item.

Arthur wrote:

) Pedantry: Typically, you'd "point to nothing" (using a value such as
) "nil" or C's "NULL"), or in rare cases point to yourself or point to a
) global object designated for the purpose. Pointing back to the first item
) sounds like a bad idea, unless you're specifically trying to make a
) circularly linked list.

I wanted to point out a non-obvious solution. :-)

) (I see how it would work, except for ugly hackishness when you go to
) remove the first item in the list and end up having to update the "next"
) pointer of the last item, too!)

And maybe I was trolling a bit for people to point out how broken it is.
It is broken by the way, I spent several days tracing a bug in someones
code who was using circular linked lists for some obscure reason.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.