My answer got repeated on this question. Almost exactly. Should/can I complain?
When talking about very basic questions such as this one, it's going to happen quite a bit. There's two very low hanging apples there to pick:
- The OP is having off by one and scope / declaration issues
- The OP doesn't need a loop in the first place
What happens isn't that people copy your answer, they don't need to copy it on such a basic question. People know the same answer that you did, and naturally they want to post it. They may (or may not) have seen your answer posted prior to adding their own. They may have skipped right from the question to the answer field and started typing away in all of the excitement we used to feel in History class when we actually knew the answer the teacher wanted. Back then, we threw our hand high up in the air and trampled over our fellow class mates, chanting the all familiar war cry ... ooooooh!!! ooooooh!!! PICK MEEEEEE!
One of the biggest reasons why I don't have 3x the rep that I do is because I read the existing answers before adding one. This results, 8/10 times in me not answering a question that I could because someone else did a fine job of answering. However, when working on unlocking reputation based privileges, people don't always show such restraint.
Wherever there's low hanging fruit, there's bound to be a feeding frenzy. This almost always means that several terse and nearly identical answers will compete. If you notice a blatant pattern of a specific user copying other answers nearly byte by byte, that's probably something we'd want to look into. Barring that, it's just part of using the site.
For a final bit of irony, I see @Shog9 has done a fine job of answering this :) But, I worked on my answer too, so I'm posting it anyway.
Should/can I complain?
You... can... And really, you sorta are...
But should you? Well, what good does it do? If he copied at all, he didn't copy your answer verbatim... so you can't exactly claim plagiarism. Both answers are fairly trivial, so it's hardly surprising if multiple people came up with the same thing independently. Heck, someone just posted another answer that's also very similar to yorus...
But more importantly, if his answer disappeared, it wouldn't improve yours. There's no real value to the community in removing it apart from a little less noise - but then, removing yours would have the exact same advantage there, and you can achieve that without saying a word...
In short, complaining accomplishes nothing. So don't bother, unless you're doing it purely for catharsis.
What should you do? How about improving your answer to make it more unique / interesting / informative? Maybe a bit of background on how and why initializers work that way. Cite the spec for extra credit. Be creative. That way, everyone wins...