Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Willem <willem@xxxxxxxx>
- Date: Tue, 10 Jan 2006 18:20:48 +0000 (UTC)
)> 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
.
- References:
- Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Casey Hawthorne
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Gerry Quinn
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: wooks
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Gerry Quinn
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: wooks
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Richard Harter
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: wooks
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Willem
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: wooks
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Willem
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Arthur J. O'Dwyer
- Interesting article by Joel Spolsky: The Perils of JavaSchools
- Prev by Date: Re: C Programmer Needed
- Next by Date: Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- Previous by thread: Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- Next by thread: Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- Index(es):