5 ms·
> However, not knowing something and doubling down on that lack of knowledge by defending something that is wrong because you don't like the tone of the person
by saagarjha 5y ago
> However, not knowing something and doubling down on that lack of knowledge by defending something that is wrong because you don't like the tone of the person correcting you about it is highly problematic and suggests you are prioritizing your own sensitivity on the issue and protecting your own ego instead of taking the opportunity to learn something new.
Reminder that I was not the one who passed up the opportunity to reply to 'einpoklum with a simple "iterators can behave like pointers, but vector's iterators don't have to be pointers. You can see this here: https://godbolt.org/z/Y5f4d74Kb https://godbolt.org/z/Y5f4d74Kb". I'm just annoyed that you went after this person for coming to an incorrect conclusion from what is clearly a correct position, which is that iterators were intended to "morally" be pointers, especially in cases where they iterate over contiguous containers. You are correct that I claimed that vector iterators must behave identically to pointers, but I really meant to say that this is only in cases where the iterator has behavior defined on it: I alluded to it previously when I mentioned that GCC and Clang wrap pointers in their own custom iterator classes to prevent people from accidentally using operations on them that are not legal. There's a bunch of other things that the iterator doesn't guarantee, like being directly casted to an integer.
But, stepping back a bit: do you really disagree with a claim that a vector iterator is meant to be a little pointer into the internal buffer it has, with a bit of additional restrictions on top that are reasonable to add? This seems to be a very strange thing to disagree with, and I would like to hear more about why you hold that position.
- gpderetta 5y agoFWIW I believe that the parent was pedantic but correct. This being C++, being pedantic is a Good Thing. The distinction between reference and pointer invalidation, and the requirements and axioms of the various iterator concepts are all valid things to point out, especially in a thread about C++ footguns.
- saagarjha 5y agoI am always down for C++ pedanticness! But in this case my issue was not with factual accuracy, but putting down the opinion of "iterators act like pointers" as coming from ignorance rather than simplification. It was mostly a complaint about tone, not content.
- CRConrad 5y ago> It was mostly a complaint about tone, not content. You say that as if you think that makes it better.
- saagarjha 5y agoAbsolutely!
- CRConrad 5y ago> > > It was mostly a complaint about tone, not content. > > You say that as if you think that makes it better. > Absolutely! Indeed, you absolutely did. Which sucks, because it absolutely isn't. HTH: https://en.wikipedia.org/wiki/Tone_policing https://en.wikipedia.org/wiki/Tone_policing (See also: https://en.wikipedia.org/wiki/Sealioning https://en.wikipedia.org/wiki/Sealioning )
- saagarjha 5y agoHacker News is a place for curious conversation, rather than a place to sneer at people's ineptness for coming to reasonable (if incorrect) conclusions. You can be completely correct, but if you're going to be a petty jerk about it then you're not helping the conversation. I provided an example response that conveys exactly the same information, except you'll note mine doesn't start with "this is a poor understanding of [general concept]". If anything, "link provided below of convenience" and "please review the following link" is far more sealioning than anything I wrote, because it hides the message of "you're an idiot who needs to read up on this topic" behind faux politeness. It's the very thing that I found disconcerting about that comment, not its factual content.