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

  • Home
  • SEARCH
  • 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 168323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:25:58+00:00 2026-05-11T12:25:58+00:00

What do you feel are best practices for the use of Option Infer in

  • 0

What do you feel are best practices for the use of Option Infer in your projects?

In Visual Studio 2008, Option Infer is a directive that allows the compiler to infer the datatype of a declared variable by looking at what is assigned to it.

This is a key feature in VS2008 and is used extensively with LINQ statements and queries. However, turning on Option Infer may create pitfalls for future maintenance programmers.

  • 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. 2026-05-11T12:25:58+00:00Added an answer on May 11, 2026 at 12:25 pm

    The type inference used by C# (and thus I presume other .net languages) is very precise (and excellent). The compiler will only allow the statement if the type is clear and unambiguous. Therefore, the outcome is not really a loss in precision … it is merely that you’re saving the developer from stating the type more than once. You’re reducing duplication in the code.

    (EDIT: Also, it is important to realize that the result is still strongly typed. The compiler knows, at compile time, exactly what type the variable is. There is nothing like a variant involved. If you type var x = 42; it simply figures out that x is an int because you put an int on the right-hand side, thus saving you some typing and duplication).

    The only reason future maintenance programmers might not understand it is if they simply don’t understand the language feature of type inference in the first place. But I think it is more sound to expect and require that maintenance programmers know the language features, than it is to avoid good language features out of fear that future programmers won’t know them.

    I guess if you’re in a situation where you know that future programmers are junior and not very knowledgeable about the language, then maybe you would avoid some things. But that makes me wonder if you should consider some other language, or even a ‘platform’ like Access which is a hybrid of ‘real programming’ and something that a non-programmer can do some things with.

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

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer There's a similar question here: Regex Grammar The answers contain… May 11, 2026 at 2:02 pm
  • added an answer The 6 digits show the file mode using the classical… May 11, 2026 at 2:02 pm
  • added an answer local $/; my $text = <>; s/<.*?>//gs; print $text; May 11, 2026 at 2:02 pm

Related Questions

When dealing with small projects, what do you feel is the break even point
What do you think the future of GPU as a CPU initiatives like CUDA
What do you think is the best way to create SEO friendly URLs (dynamically)
What do you find is the optimal setting for mysql slow query log parameter,
What do you think the benefits of functional programming are? And how do they
And what do you put in your View? A recent blog from Scott Hanselman
I'm currently in the process of testing our solution that has the whole gamut
My question is pertaining to the best practice for accessing a child object's parent.
What is the best practice on setting and keeping these global objects ? I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.