September 2022

S M T W T F S
    123
45678910
11121314151617
181920 21222324
2526 27282930 

Style Credit

Expand Cut Tags

No cut tags
Friday, October 25th, 2002 11:10 pm


I'm vain and arrogant. I'm usually able to keep it under control, but I still have trouble doing things like showing my work. A part of me insists that a superior individual like myself shouldn't need to write out steps. Instead the answer should leap out of my obviously superior head full-formed, terrorizing the normals around me with its brilliance.

This is, of course, crap. And for the most part I got over it in college. Not surprisingly, my grades went way up about that time.

But it still haunts me. One thing I have trouble forcing myself to do is sketch out linked list operations. Being the stupid kind of lazy, I've implemented hundreds of linked lists. I should be able to do it blindfolded. But I can't. If I don't sketch it out I always forget something stupid and create a very annoying bug. But I still feel like a complete tool sketching it out.

So there I was, implementing yet another linked list, when my eyes fell upon the lump of silly putty that lives on top of my monitor. Eureka! A way to visualize the linked list yet leave no trace of having done so! It was so great that I rushed to document it fully and leave a public trace of having done so right here.

So I started with a doubly linked list, three items long, with head and tail pointers. I wanted, let's say, to remove the tail. First I added a pointer to the tail item. Then I moved the tail pointer to point at the second to last item. Next I pointed the tail item's next pointer to NULL. Finally, just to be safe, I pointed the prev pointer on the removed item to NULL.

If this technique becomes popular, imagine the number of needless, pig-headed bugs that can be avoided.

Saturday, October 26th, 2002 02:55 am (UTC)
I... have no idea how to respond to this.

That beats bringing cool machining shavings home in tiny origami boxes any day, I think.