This is all coming from you. I didn't say anything about .NET being
buggy. It's out of your mouth that it's being said.
All of your posts have defended the claim that the loop will "blow up"
based on the assertion that "MS solutions" don't do what they're supposed
to. I'm not sure how I'm supposed to interpret that other than you
claiming .NET is buggy.
All I said was not to decrement (i) like that, that the loop is
controlling, which could possibly lead to a termination at RemoveAt(i)..
The only way decrementing the variable i "could possibly lead to a
termination at RemoveAt(i)" is if .NET is buggy. The language is
well-defined and the behavior of the loop is well-defined based on the
language, and according to the language definition, the loop has no
trouble at all with decrementing the variable i in the loop. So, again,
the only way anything wrong could happen is if .NET doesn't implement the
language correctly.
In other words, it's buggy.
Normally, one does't decrement (i) like that in a loop. Normally, one
lets the loop increment or decrement the count itself. Now, one could do
an j=i-1 or j=i+1 and work with j, but one doesn't mess with (i). That's
kind of common sense.
I beg to differ. I agree that it's generally poor convention to modify a
loop counter from within the loop, but both C and C#, and any number of
other languages, do permit it and the behavior is well-defined.
[...]
Either way, there is nothing wrong at all with the code that was
posted, not in the way you claim.
Again, I never said there was nothing wrong with the code. This is
coming out of your mouth, not mine.
You said it would "blow up". How is that not saying that there's
something wrong with the code?
[...]
Well, you can't come up with number of months or years, then that tells
me not long at all.
I have been programming MS solutions, since 1994. I been programming
business solutions since 1980. I have been in the IT field since 1971
and still going strong.
lol...I didn't realize this was a pissing contest. Sorry. I admit, I
haven't been "in the IT field since 1971", but I have a lot more
experience than you are giving me credit for (and more experience with
Microsoft and Windows than you yourself have). In any case, this
discussion isn't about who has the most experience. If I had only been
writing Windows software for 12 months, my statements would be just as
correct as they are given the experience I do have.
Will you get off of the loop, you have beaten the loop into the ground..
Why would I comment on anything *but* the loop? This entire thread is
about the loop.
[...]
without the extra decrement, and the statement "you're going to
eventually blow up at that RemoveAt(i)" would be just as true as it
was with the original code.
I didn't see your suggestion nor do I care to see it either.
I suppose that's your prerogative. I was simply using my other post
elsewhere in this thread as an informative example. If you don't care to
consider all of the available information, you are free to choose not to..
[...]
I am not even talking about some user scenarios that had not been
anticipated. It's more along the lines of Com and Com+ solutions being
used in a enterprise solution.
which things didn't work as aspected, with the same code working without
Com+, as an example.
In what way is that relevant to whether one should modify a loop counter
from within the loop?
You are one of these people that has a corn cob stuck up your behind,
you know it all, you got to prove it and you got a mental problem.
It's true, I have an almost pathological need to get the details right.
Turns out that's actually a useful personality trait in the programming
business. Still, my pathological need to get the details right doesn't
change the incorrectness of claiming that there's something fundamentally
wrong with modifying the loop index from within the loop.
As near as I can tell, the main reason my pathological need to get the
details right annoys you so much is that you yourself have the details
wrong, and pointing that out bothers you for some reason.
For what it's worth, I've made my own share of mistakes posting in this
newsgroup (and others, for that matter). People have pointed those
mistakes out, and rather than getting all defensive about it, I simply
admit my mistake and move on. You might consider that approach as being
more useful and productive in your own posts.
Nobody is perfect, and nobody should expect anyone else to be perfect.
The real question is whether a person has enough character to admit their
mistake and learn from it, rather than dig in their heels and create a
mountain out of a molehill.
Pete