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 8139409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:48:52+00:00 2026-06-06T11:48:52+00:00

A newbie question. Arrays in C# return a non generic (classic) IEnumerator. Other collections

  • 0

A newbie question.

Arrays in C# return a non generic (classic) IEnumerator. Other collections can supply either.

In general, is it bettter use a generic enumerator if it is available, eg for reasons of type safety? Are there times when the non-generic option is preferable?

  • 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-06-06T11:48:53+00:00Added an answer on June 6, 2026 at 11:48 am

    Usually it’s highly preferable to use generic enumerations, for, as you mentioned in question, type safety.

    Non generic enumeration can be a choice in case when you store just a collection of objects.
    So instead of writing IEnumerable<object>, you write IEnumerable and figure out the real object type inside the iteration (if you need that, but usually yes).

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

Sidebar

Related Questions

Sorry for the incredibly newbie question, but I can see myself drifting into bad
Another newbie question. The goal: each ingredient can have zero or more unit conversions
Newbie question: Can one substitue commands, properties or methods for NSStrings or char at
This must be a newbie question but... How can I achieve $_GET['i'] array from
I'm a newbie and I have a very basic question about PHP arrays Code:
Newbie question. Looking at arrays (ie: dynamically sized) this works: NSArray *array; array =
this is a bit of a newbie question but I can't seem to find
Newbie question... The objective: I intend to have an HTML text input field as
Newbie question: I just installed VisualSVN Server and created a repository. I noticed that
Newbie question here. I'm in the beginning stages of laying out a site in

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.