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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:45:06+00:00 2026-05-19T15:45:06+00:00

I know msdn should probably be the first place to go and it will

  • 0

I know msdn should probably be the first place to go and it will be after I get the scoop here. What the msdn would not really provide as part of the technical specification is what I am about to ask now:

  1. How exactly the subject is useful in day to day development process?
  2. Does it have a correlation in any shape or form with anonymous types inside clr?
  3. What does it allow for what otherwise could not have been done without it?
  4. Which .net features are dependent upon the subject and could not have exist without as part of the framework?

To bring a note of specifics to the question, it would be really interesting to know (in pseudo code) of how the compiler can actually determine the needed type if the method was called using lambdas and type inference

I am looking to see the compiler logical flow on how to locate that type.

  • 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-19T15:45:07+00:00Added an answer on May 19, 2026 at 3:45 pm

    Type inference occurs in many places in C#, at least the following:

    1. The var keyword, which tells the compiler to infer (deduce) the correct type for the variable from what you initialize it with
    2. The ability to leave type parameters out of a generic method call as long as they can be deduced from the parameters
    3. The ability to leave out types from lambda expression arguments, as long as they can be deduced

    And to answer your questions:

    1) It saves a lot of typing, especially when using the so-called “LINQ methods”. Compare for example

    List<string> myList = new List<string>();
    // ...
    IEnumerable<string> result = myList.Where<string>((string s) => s.Length > 0)
        .Select<string, string>((string s) => s.ToLower());
    

    versus

    var myList = new List<string>();
    // ...
    var result = myList.Where(s => s.Length > 0).Select(s => s.ToLower());
    

    2) I don’t know what you mean by “correlation”, but without the var keyword you couldn’t have variables refer to anonymous types in a type-safe way (you could always use object or dynamic), which makes it pretty important when using anonymous types.

    3) Nothing as far as I can think of. It’s only a convenience feature. Of course its absence would make, for instance, the aforementioned anonymous types less useful, but they’re mostly a convenience feature as well.

    4) I think 3) answers this as well.

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

Sidebar

Related Questions

I have seen this syntax in MSDN: yield break , but I don't know
Are the latest expression tools covered under a Microsoft MSDN subscription? I know in
I know, I would have thought the answer was obviously no as well, but
Do you know how to remove margin (probably the one for image and check
I have been pondering why it is recommended that we should not release managed
Know of an OCAML/CAML IDE? Especially one that runs on Linux?
Know of any good libraries for this? I did some searches and didn't come
I know in certain circumstances, such as long running processes, it is important to
I know Microsoft has made efforts in the direction of semantic and cross-browser compliant
Anyone know if it's possible to databind the ScaleX and ScaleY of a render

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.