2

The tag. I've never used it, but I see it pop up in a lot of questions that have nothing even remotely do with the foreach loop. Even though they may contain the code. It's very rarely the actual subject of the question.

Why would I use this tag and when?

For example, this question: Insert jQuery Calender in a "Foreach" Statement Gridview

The subject is not the foreach loop, but the jQuery date picker. Is it still applicable to tag this with ?

5
  • Tags are often misused. This should probably be a request to have the tag cleaned up, with a few examples of misuse provided. Mar 27, 2014 at 10:34
  • @Dukeling I'm not sure if they do constitute misuse though. Personally I do, but I'm not sure if that's the general consensus. I've added an example of what I'm talking about. Mar 27, 2014 at 10:39
  • I figured you were talking about something more like this. Mar 27, 2014 at 10:42
  • @Dukeling That's probably one I would nail down to definitely not requiring a foreach tag. Just seems like an odd thing to tag a question with. Mar 27, 2014 at 10:47
  • I don't think foreach requires a tag. Does every programming construct within a language (or even a language-agnostic construct) need a tag of its own? I'd say remove the tag.
    – Zesty
    Jan 25, 2017 at 12:58

1 Answer 1

6

If the code in the question contains some construct, but the question isn't directly about it, it shouldn't contain the tag associated with it.

Although I usually view removing it as a minor edit, perhaps incorrectly so, and whether or not a question is actually about a construct is perhaps arguable in some cases.

I could be wrong, but this seems like a decent use of the tag - it's specifically about trying to break from a foreach loop.


You could take another stance saying that any question which requires familiarity with something should have the associated tag, but then there's basically no point to having any of the following tags (to name a few): , , , , , , , , as many questions require familiarity with many such constructs, while a question can only have 5 tags, and it would be next to impossible to identify a question actually about one of these constructs (such questions would be my main argument for not getting rid of the above tags).

1
  • 1
    there is no point at all in having any of the tags foreach, for-loop, while-loop, break, continue, do-while. they all just fall under control flow or "programming" or the language in question.
    – Fattie
    Aug 10, 2015 at 3:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .