Hi Mike,

I didn't analyze your code, but as I said (or maybe I was thinking of
saying it but do not) is that JavaScript, to me, a guy is extremely
strict and high software quality development practices, promotes bad
coding habits.  I say that because I have already caught myself doing
stuff that I would not otherwise just because javascripts allows it.

So in this case, the idea that the associated array for loop
interation is not ordered is reason enough not to bother with any more
with it. Even though, as you indicated and I believe you, it is
harmless and it is very tempting to use that logic,  I just do not
feel right it won't pull the rug from under the feet of the internal
loop counters or references in various javascript RTEs.

So even though JS may allow it, from a design standpoint, to me, it is
bad practice to wrote code with this behavior simply because it can
carry over to other languages where it will definitely be an run time
error.  I am already fighting global variables :-)  I'm trying to
write code in JS like its real OOPs language and its really not. :-)

I don't think it is off topic because anything that has to do with
Javascript is related to jQuery.    In this thread, I was designing a
cache for a jQuery plugin.  Also,  when I posted the original message,
I was also thinking that maybe someone would mention jQuery's own
makeArray and related ideas to see and/or mention how jQuery maintains
its own cache.

Anyway, are you really going to make use study your code to see what
was wrong with it? :-) just tell us. <g>

--
HLS

On Oct 12, 8:29 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> > From: Michael Geary
>
> > Just for fun, here's a primitive little cache implementation
> > that lets you add/remove/get items and also prune items from
> > the beginning of the list...
>
> And if anyone tries to use that code for anything, beware! It has a serious
> bug. (Do you see what it is?)
>
> If anyone is interested, I'll post an update when I get a chance (maybe
> after the weekend). Otherwise I'll leave it as the proverbial exercise for
> the reader for the moment. :-) It's probably off topic for this list
> anyway...
>
> -Mike

Reply via email to