Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:40:43+00:00 2026-05-13T17:40:43+00:00

In a coding standards document, I found this statement: Avoid using foreach to iterate

  • 0

In a coding standards document, I found this statement:

Avoid using foreach to iterate over
immutable value-type collections.
E.g. String arrays.

Why should this be avoided ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:40:43+00:00Added an answer on May 13, 2026 at 5:40 pm

    You shouldn’t avoid it. The coding standard document you’re reading is talking nonsense. Try to find the author and ask him to explain.

    Aside from anything else, string is a reference type and arrays are always mutable… this makes me concerned about the quality of the rest of the document, to be honest. Are there any other suspicious recommendations?

    (It’s possible that “immutable” was meant to refer to the value type rather than the collection – the fact that it’s ambiguous is another worrying sign, IMO.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My team has recently started using Lance Hunt's C# Coding Standards document as a
This is an subjective question, I need your feels and thoughts about coding standards,
here C programming Guidelines and coding standards says we have to avoid magic numbers
I was reading some C# coding standards and it has this: The event handler
Coding standards in place mean I do not have an option of using ajax
I found the following rule in a coding standards sheet : Do not rely
A company's internal c++ coding standards document states that even for basic data types
It's more of a coding standards question this one. Which one is, if I
From Herb Sutter and Andrei Alexandrescu's 'C++ Coding Standards', Item 16: Avoid Macros under
The GNU coding standards document says: It is also important for function definitions to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.