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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:16:52+00:00 2026-06-05T07:16:52+00:00

Properties are expected to perform similarly to fields, even though they are really functions.

  • 0

Properties are expected to perform similarly to fields, even though they are really functions. What can be said about the expected performance of an arbitrary IEnumerable?

Is it fair to borrow the concept from properties and say that an IEnumerable should perform about the same as iterating an array or List<T>?

Or, is it okay for just about anything happen with each iteration: database access, web service call, time-consuming computation, etc.

  • 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-05T07:16:53+00:00Added an answer on June 5, 2026 at 7:16 am

    Speaking from experience you can’t really infer anything about the performance of an arbitrary IEnumerable. For example, it might be an IQueryable in disguise, hitting the database every time it is enumerated. Or it might be the result of File.EnumerateLines.

    Sometimes it is important that the enumerable only be enumerated once.

    This is in contrast to a property. If a property was to hit the database or read I file I’d consider this to be a code smell. For an IEnumerable it is just normal.

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

Sidebar

Related Questions

How can I document an object property with the object properties expected? For instance,
I can get image properties: imgObj.Width imgObj.Height But how do I get its top
Can I pass some properties to an EntityManagerFactory by code, while still maintaining persistence.xml
I'm writing a GUI application where I need to enable editing properties of arbitrary
When I run the code below, a new User with the expected properties is
Can Ant properties set via properties file, resolve other properties from properties files? For
How can I add custom properties into control objects in ExtJs. For example :
Is there somewhere I can find out the expected time and space complexities of
I'm a bit confused about properties in python. Consider the following code class A:
When using JAXB with Java-First, fields/properties of type java.util.Date are marshalled and unmarshalled as

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.